public final class SpringVersion
extends java.lang.Object
Note that some ClassLoaders do not expose the package metadata, hence this class might not be able to determine the Spring version in all environments. Consider using a reflection-based check instead: For example, checking for the presence of a specific Spring 5.0 method that you intend to call.
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getVersion()
Return the full version string of the present Spring codebase,
or
null if it cannot be determined. |
@Nullable public static java.lang.String getVersion()
null
if it cannot be determined.Package.getImplementationVersion()