Class 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.
    • Constructor Detail

      • PomIO

        @Inject
        public PomIO​(org.commonjava.maven.ext.common.session.MavenSessionHandler handler)
      • PomIO

        public PomIO()
    • 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. Uses ModelETL 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.