Class MavenUtil


  • public class MavenUtil
    extends java.lang.Object
    Maven-related utility methods.
    • Constructor Summary

      Constructors 
      Constructor Description
      MavenUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Properties loadPomProperties​(java.lang.String groupId, java.lang.String artifactId)
      Loads the Maven pom.properties for the specified artifact.
      static java.lang.String loadVersion​(java.lang.String groupId, java.lang.String artifactId, java.lang.String defaultVersion)
      Loads the version number from the pom.properties file for the specified artifact.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MavenUtil

        public MavenUtil()
    • Method Detail

      • loadPomProperties

        public static java.util.Properties loadPomProperties​(java.lang.String groupId,
                                                             java.lang.String artifactId)
                                                      throws java.io.IOException
        Loads the Maven pom.properties for the specified artifact.
        Parameters:
        groupId - The artifact's group ID.
        artifactId - The artifact's ID.
        Returns:
        The parsed pom properties, or null if the resource could not be found.
        Throws:
        java.io.IOException
      • loadVersion

        public static java.lang.String loadVersion​(java.lang.String groupId,
                                                   java.lang.String artifactId,
                                                   java.lang.String defaultVersion)
        Loads the version number from the pom.properties file for the specified artifact.
        Parameters:
        groupId - The artifact's group ID.
        artifactId - The artifact's ID.
        defaultVersion - The version number to return in case no version number was found.
        Returns:
        version as a string