Class ClassicVersionUtil


  • public class ClassicVersionUtil
    extends Object
    Utility class for retrieving version information for the "logback-classic" module. This class provides functionality to read and parse self-declared properties files containing version metadata specific to the logback-classic module. It includes methods to locate the version properties file, extract the version string based on specified conventions, and return the retrieved information.
    • Method Detail

      • getVersionBySelfDeclaredProperties

        public static String getVersionBySelfDeclaredProperties()
        Retrieves the version information for the "logback-classic" module based on its self-declared properties. The method looks for a properties file named "logback-classic-version.properties" within the classpath, reads its contents, and fetches the value associated with the "logback-classic-version" key.

        Note that the Class.getResourceAsStream() method checks that the resource is open to the caller. This entails that the caller must be in the same module as the properties file.

        Returns:
        the version string of the "logback-classic" module if found, or null if the properties file or version key is not present or an error occurs while reading the properties file.
        Since:
        1.5.26