public final class PomUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
addNewModule(java.lang.String artifactId,
java.io.Reader fileReader,
java.io.Writer fileWriter)
Adds module
artifactId unless the module already presents in fileReader . |
public static boolean addNewModule(java.lang.String artifactId, java.io.Reader fileReader, java.io.Writer fileWriter) throws ArchetypeTemplateProcessingException, InvalidPackaging, java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, javax.xml.transform.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.java.io.IOException
- if I/O errorInvalidPackaging
- if packaging is not "pom" or not exist in POMArchetypeTemplateProcessingException
- if "project" does not exist or "modules" element is duplicatedjavax.xml.parsers.ParserConfigurationException
- if parser errororg.xml.sax.SAXException
- if parser errorjavax.xml.transform.TransformerException
- if an error writing to fileWriter
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.