Class PomUtils
java.lang.Object
org.apache.maven.archetype.common.util.PomUtils
POM helper class.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
addNewModule
(String artifactId, Reader fileReader, Writer fileWriter) Adds moduleartifactId
unless 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 moduleartifactId
unless the module already presents infileReader
.- Parameters:
artifactId
- artifactId of module to addfileReader
- source POM XMLfileWriter
- target XML- Returns:
true
if modules section in POM is empty or does not exist orartifactId
does not appear a module infileReader
XML.- 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
-