Class VersionInfoUtil


  • public final class VersionInfoUtil
    extends Object
    Utility method for generating and validation version info.
    • Method Detail

      • getVersionInfoProperties

        public static Properties getVersionInfoProperties​(org.apache.maven.project.MavenProject project)
        Detects versions from maven-conga-plugin and additional CONGA plugins used.
        Parameters:
        project - Maven project
        Returns:
        Properties with versions
      • cleanupSnapshotVersion

        public static String cleanupSnapshotVersion​(String versionLine)
        Replaces "static" snapshot version like 2.1.2-20180125.094723-16 with dynamic ones like 2.1.2-SNAPSHOT.
        Parameters:
        versionLine - Version line
        Returns:
        Reformatted version line
      • getPluginVersionFromPluginManagement

        public static String getPluginVersionFromPluginManagement​(String pluginKey,
                                                                  org.apache.maven.project.MavenProject project)
        Get version of Maven plugin. If it is not defined as active plugin in the current project, try to fetch version from plugin management.
        Parameters:
        pluginKey - Plugin key
        project - Maven project
        Returns:
        Plugin version or null if not defined