Package de.oktoflow.platform.cmdTools
Class ChangePomVersion
java.lang.Object
de.oktoflow.platform.cmdTools.ChangePomVersion
Changes POM versions.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateChangePomVersion(String[] args) Creates a program instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringEmulates reading a Spring-like parameter if the configuration is not yet in place.private booleanReturns whether a file is ok according to inclusion and exclusion patterns.private booleanisValid()Returns whether the setup is valid.static voidChanges POM versions.private voidProcessesfile.private static PomReader.ResultreplaceManifestVersion(File file, String oldVersion, String newVersion) Replaces bundle versions in Manifest files.private voidScansfile.private static StringstripSuffix(String text, String suffix) Strips the suffix.
-
Field Details
-
PARAM_PREFIX
- See Also:
-
PARAM_VALUE_SEP
- See Also:
-
SUFFIX_SNAPSHOT
- See Also:
-
SUFFIX_QUALIFIER
- See Also:
-
KEY_BUNDLE_VERSION
- See Also:
-
oldPomVersion
-
newPomVersion
-
oldParentPomVersion
-
newParentPomVersion
-
simulate
private boolean simulate -
verbose
private boolean verbose -
modifyManifest
private boolean modifyManifest -
incPattern
-
excPattern
-
groupIdPattern
-
properties
-
-
Constructor Details
-
ChangePomVersion
Creates a program instance.- Parameters:
args- the command line arguments- Throws:
PatternSyntaxException- if a RegEx is invalid
-
-
Method Details
-
isValid
private boolean isValid()Returns whether the setup is valid.- Returns:
truefor valid,falseelse
-
scan
Scansfile.- Parameters:
file- file or directory to scan for processing
-
process
Processesfile.- Parameters:
file- the file (not directory) to process
-
stripSuffix
Strips the suffix.- Parameters:
text- the text to modifysuffix- the suffix to look for- Returns:
- the text with suffix replaced
-
replaceManifestVersion
private static PomReader.Result replaceManifestVersion(File file, String oldVersion, String newVersion) throws IOException Replaces bundle versions in Manifest files.- Parameters:
file- the file to modifyoldVersion- the old (mvn) versionnewVersion- the new (mvn) version- Returns:
- the result state
- Throws:
IOException- if reading/writing fails
-
isOk
Returns whether a file is ok according to inclusion and exclusion patterns.- Parameters:
file- the file to check- Returns:
truefor ok,falseelse
-
getArg
Emulates reading a Spring-like parameter if the configuration is not yet in place.- Parameters:
args- the argumentsargName- the argument name (withoutPARAM_PREFIXorPARAM_VALUE_SEP)dflt- the default value if the argument cannot be found- Returns:
- the value of argument or
deflt
-
main
Changes POM versions.- Parameters:
args-
-