Class PomUtils
java.lang.Object
org.apache.maven.archetype.common.util.PomUtils
POM helper class.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaddNewModule(String artifactId, Reader fileReader, Writer fileWriter) Adds moduleartifactIdunless the module already presents infileReader.
-
Method Details
-
addNewModule
public static boolean addNewModule(String artifactId, Reader fileReader, Writer fileWriter) throws ArchetypeTemplateProcessingException, InvalidPackaging, IOException, ParserConfigurationException, SAXException, TransformerException Adds moduleartifactIdunless the module already presents infileReader.- Parameters:
artifactId- artifactId of module to addfileReader- source POM XMLfileWriter- target XML- Returns:
trueif modules section in POM is empty or does not exist orartifactIddoes not appear a module infileReaderXML.- Throws:
IOException- if I/O errorInvalidPackaging- if packaging is not "pom" or not exist in POMArchetypeTemplateProcessingException- if "project" does not exist or "modules" element is duplicatedParserConfigurationException- if parser errorSAXException- if parser errorTransformerException- if an error writing tofileWriter
-