public final class PomUtils extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
addNewModule(String artifactId,
Reader fileReader,
Writer fileWriter)
Adds module
artifactId unless the module already presents in fileReader . |
public static boolean addNewModule(String artifactId, Reader fileReader, Writer fileWriter) throws ArchetypeTemplateProcessingException, InvalidPackaging, IOException, ParserConfigurationException, SAXException, TransformerException
artifactId
unless the module already presents in fileReader
.artifactId
- artifactId of module to addfileReader
- source POM XMLfileWriter
- target XMLtrue
if modules section in POM is empty or does not exist or artifactId
does not appear
a module in fileReader
XML.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 to fileWriter
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.