Class PomUtils

java.lang.Object
com.sap.cds.maven.plugin.util.PomUtils

public class PomUtils extends Object
A utility class to manipulate pom.xml files.
  • Method Details

    • addDependency

      public static boolean addDependency(Document doc, String groupId, String artifactId, String version, String scope) throws org.apache.maven.plugin.MojoExecutionException
      Adds a dependency to given pom.xml DOM if it doesn't exist yet.
      Parameters:
      doc - the pom.xml DOM
      groupId - the dependency's groupId
      artifactId - the dependency's artifactId
      version - the dependency's version
      Returns:
      true if dependency was added
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if document manipulation failed
    • addModule

      public static boolean addModule(Document doc, String module) throws org.apache.maven.plugin.MojoExecutionException
      Adds a module to given pom.xml DOM if it doesn't exist yet.
      Parameters:
      doc - the pom.xml Document node
      module - the module to add
      Returns:
      true if module was added
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if document manipulation failed
    • addCdsCommand

      public static boolean addCdsCommand(Document doc, String cmd) throws org.apache.maven.plugin.MojoExecutionException
      Adds a CDS command line to the exeuction of the cds goal.
      Parameters:
      doc - the pom.xml Document node
      cmd - the CDS command line to add
      Returns:
      true if command was added
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if document manipulation failed