Class PomManipulator


  • public class PomManipulator
    extends Object
    Provides methods to manipulate pom files. Copied and modified from blueprint-extension-maven-plugin project
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addDependencies​(org.apache.maven.project.MavenProject project, List<org.apache.maven.model.Dependency> dependencies, org.apache.maven.plugin.logging.Log log)
      Add the given dependencies to the dependencies of the given project.
      static void addDependency​(org.apache.maven.project.MavenProject project, org.apache.maven.model.Dependency dependency, org.apache.maven.plugin.logging.Log log)
      Add the given dependency to the dependencies of the given project.
    • Method Detail

      • addDependency

        public static void addDependency​(@Nonnull
                                         org.apache.maven.project.MavenProject project,
                                         @Nonnull
                                         org.apache.maven.model.Dependency dependency,
                                         @Nonnull
                                         org.apache.maven.plugin.logging.Log log)
                                  throws org.apache.maven.plugin.MojoExecutionException
        Add the given dependency to the dependencies of the given project. After adding the dependencies the pom file will be rewritten.
        Parameters:
        project - - the project to manipulate
        dependency - - the dependency which should be added
        log - -Maven Logger to Log what happens
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • addDependencies

        public static void addDependencies​(@Nonnull
                                           org.apache.maven.project.MavenProject project,
                                           List<org.apache.maven.model.Dependency> dependencies,
                                           org.apache.maven.plugin.logging.Log log)
                                    throws org.apache.maven.plugin.MojoExecutionException
        Add the given dependencies to the dependencies of the given project. After adding the dependencies the pom file will be rewritten.
        Parameters:
        project - - the project to manipulate
        dependencies - - the dependencies which should be added
        log - -Maven Logger to Log what happens
        Throws:
        org.apache.maven.plugin.MojoExecutionException