Package com.sap.cds.maven.plugin.util
Class PomUtils
java.lang.Object
com.sap.cds.maven.plugin.util.PomUtils
A utility class to manipulate pom.xml files.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaddCdsCommand(Document doc, String cmd) Adds a CDS command line to the exeuction of the cds goal.static booleanAdds a dependency to given pom.xml DOM if it doesn't exist yet.static booleanAdds a module to given pom.xml DOM if it doesn't exist yet.
-
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 DOMgroupId- the dependency's groupIdartifactId- the dependency's artifactIdversion- the dependency's version- Returns:
trueif 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.xmlDocumentnodemodule- the module to add- Returns:
trueif 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.xmlDocumentnodecmd- the CDS command line to add- Returns:
trueif command was added- Throws:
org.apache.maven.plugin.MojoExecutionException- if document manipulation failed
-