Class PomFinder
java.lang.Object
org.apache.maven.shared.release.util.PomFinder
This utility class helps with finding a maven pom file which got parsed previously. It uses the fact that the combination of any parent ids plus the ids of the current pom itself is unique.
This is e.g. needed for SCM systems which do not support sparse checkout but only can checkout the repository as whole like e.g. GIT. If the module which we are going to release is not in the parent directory, we first need to search for the 'right' sub directory in this case. subdirectory
Usage:
PomFinder is a statefull class. One instance of this class intended for a singular use! You need to create a new instance if you like to search for another pom.invalid input: '<'/p
-
Parse an origin pom in a given directory with
parsePom(java.io.File)
This will act as the information about what to search for. -
Search for the matching pom in a given tree using
findMatchingPom(java.io.File)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Data container which helds information about a pom. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PomFinder.PomInfo
private org.codehaus.plexus.logging.Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindMatchingPom
(File startDirectory) Search for the previously withparsePom(java.io.File)
parsed pom in the given directory.boolean
private PomFinder.PomInfo
readPomInfo
(File pomFile) Read thePomFinder.PomInfo
from the given pom file
-
Field Details
-
log
private org.codehaus.plexus.logging.Logger log -
foundPomInfo
-
-
Constructor Details
-
PomFinder
public PomFinder(org.codehaus.plexus.logging.Logger log)
-
-
Method Details
-
parsePom
- Parameters:
originPom
- the pom File which should be used as blueprint for the search- Returns:
true
if a pom got parsed successfully,false
otherwise
-
findMatchingPom
Search for the previously withparsePom(java.io.File)
parsed pom in the given directory.- Parameters:
startDirectory
-- Returns:
- the pom file which matches the previously parsed pom or
null
if no matching pom file could have been found.
-
readPomInfo
private PomFinder.PomInfo readPomInfo(File pomFile) throws IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException Read thePomFinder.PomInfo
from the given pom file- Parameters:
pomFile
- pom.xml file- Returns:
- the PomInfo or
nullinvalid input: '<'/code
- Throws:
IOException
org.codehaus.plexus.util.xml.pull.XmlPullParserException
-