Class VersionUtil
java.lang.Object
ch.qos.logback.core.util.VersionUtil
Utility class for handling and validating version information of various artifacts.
It is used by logback-classic, logback-access-common, logback-access-jetty11, logback-access-tomcat, etc. to alert users about version discrepancies between depender and dependency artifacts.
- Since:
- 1.5.25
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedVersionUtil(Context context) Instance methods allow for polymorphism, static methods do not. -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddFoundVersionStatus(Context context, String name, String version) static voidcheckForVersionEquality(Context context, String dependerVersion, String dependencyVersion, String dependerName, String dependencyName) Compares the versions of a depender and a dependency to determine if they are equal.voidcompareExpectedAndFoundVersion(String actualDependencyVersion, Class<?> dependerClass, String dependerVersion, String dependerName, String dependencyName) Compares the expected version of a dependency with the actual version found and updates the status context.protected StringgetExpectedVersionOfDependencyByProperties(Class<?> dependerClass, String propertiesFileName, String dependencyNameAsKey) protected static Stringstatic String
-
Constructor Details
-
VersionUtil
Instance methods allow for polymorphism, static methods do not.- Parameters:
context-- Since:
- 1.5.30
-
-
Method Details
-
nonNull
-
getExpectedVersionOfDependencyByProperties
protected String getExpectedVersionOfDependencyByProperties(Class<?> dependerClass, String propertiesFileName, String dependencyNameAsKey) -
checkForVersionEquality
public static void checkForVersionEquality(Context context, String dependerVersion, String dependencyVersion, String dependerName, String dependencyName) Compares the versions of a depender and a dependency to determine if they are equal. Updates the context's status manager with version information and logs a warning if the versions differ.- Since:
- 1.5.26
-
addFoundVersionStatus
-
nameToPropertiesFilename
-
compareExpectedAndFoundVersion
public void compareExpectedAndFoundVersion(String actualDependencyVersion, Class<?> dependerClass, String dependerVersion, String dependerName, String dependencyName) Compares the expected version of a dependency with the actual version found and updates the status context. If the versions do not match, a warning is added to the context's status manager.Note: This method is used be logback-access-jetty11/12 and logback-access-tomcat.
-