Package org.commonjava.maven.ext.io
Class PomIO
- java.lang.Object
-
- org.commonjava.maven.ext.io.PomIO
-
@Named @Singleton public class PomIO extends Object
Utility class used to read raw models for POMs, and rewrite any project POMs that were changed.
-
-
Field Summary
Fields Modifier and Type Field Description static String
PARSE_POM_TEMPLATES
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.commonjava.maven.ext.common.model.Project>
parseProject(File pom)
ProjectVersionRef
rewritePOMs(Set<org.commonjava.maven.ext.common.model.Project> changed)
For any project listed as changed (tracked by GA in the session), write the modified model out to disk.void
writeModel(Model model, File target)
Writes out the Model to the selected target file.
-
-
-
Field Detail
-
PARSE_POM_TEMPLATES
public static final String PARSE_POM_TEMPLATES
- See Also:
- Constant Field Values
-
-
Method Detail
-
parseProject
public List<org.commonjava.maven.ext.common.model.Project> parseProject(File pom) throws org.commonjava.maven.ext.common.ManipulationException
- Throws:
org.commonjava.maven.ext.common.ManipulationException
-
rewritePOMs
public ProjectVersionRef rewritePOMs(Set<org.commonjava.maven.ext.common.model.Project> changed) throws org.commonjava.maven.ext.common.ManipulationException
For any project listed as changed (tracked by GA in the session), write the modified model out to disk. UsesModelETL
to preserve as much formatting as possible.- Parameters:
changed
- the modified Projects to write out.- Returns:
- gav execution root GAV
- Throws:
org.commonjava.maven.ext.common.ManipulationException
- if an error occurs.
-
writeModel
public void writeModel(Model model, File target) throws org.commonjava.maven.ext.common.ManipulationException
Writes out the Model to the selected target file.- Parameters:
model
- the Model to write out.target
- the file to write to.- Throws:
org.commonjava.maven.ext.common.ManipulationException
- if an error occurs.
-
-