Class PomFile


  • public class PomFile
    extends java.lang.Object
    • Field Detail

      • DEFAULT_XML_ENCODING

        private static final java.lang.String DEFAULT_XML_ENCODING
        See Also:
        Constant Field Values
      • parser

        private static de.pdark.decentxml.XMLParser parser
      • document

        private de.pdark.decentxml.Document document
      • project

        private de.pdark.decentxml.Element project
      • version

        private java.lang.String version
        The (effective) project version
      • preferExplicitProjectVersion

        private final boolean preferExplicitProjectVersion
      • isMutable

        private final boolean isMutable
    • Constructor Detail

      • PomFile

        public PomFile​(de.pdark.decentxml.Document pom,
                       boolean isMutable)
    • Method Detail

      • read

        public static PomFile read​(java.io.File file,
                                   boolean isMutable)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • read

        public static PomFile read​(java.io.InputStream input,
                                   boolean isMutable)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public static void write​(PomFile pom,
                                 java.io.OutputStream out)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public static void write​(PomFile pom,
                                 java.io.File file)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • getExplicitVersionFromXML

        private java.lang.String getExplicitVersionFromXML()
      • setVersionInXML

        private void setVersionInXML()
      • addEmptyVersionElementToXML

        private static de.pdark.decentxml.Element addEmptyVersionElementToXML​(de.pdark.decentxml.Element project)
      • removeVersionElementFromXML

        private static void removeVersionElementFromXML​(de.pdark.decentxml.Element project)
      • setParentVersion

        public void setParentVersion​(java.lang.String newVersion)
        Sets the version in the parent POM declaration. This never affects the (effective) version of the project itself.
        See Also:
        setVersion(String)
      • setVersion

        public void setVersion​(java.lang.String version)
        Sets the version of the project.
      • getVersion

        public java.lang.String getVersion()
        Returns the (effective) version of the project.
      • getPackaging

        public java.lang.String getPackaging()
      • getParentVersion

        public java.lang.String getParentVersion()
      • getExplicitGroupId

        private java.lang.String getExplicitGroupId()
      • getGroupId

        public java.lang.String getGroupId()
        Returns the (effective) groupId of the project.
      • getArtifactId

        public java.lang.String getArtifactId()
      • getParent

        public GAV getParent()
      • getModules

        public java.util.List<java.lang.String> getModules()
      • getProfiles

        public java.util.List<Profile> getProfiles()
      • getDependencies

        public java.util.List<GAV> getDependencies()
      • getBuild

        public Build getBuild()
      • getProperties

        public java.util.List<Property> getProperties()
      • getElementValue

        private java.lang.String getElementValue​(java.lang.String name)
      • isMutable

        public boolean isMutable()