The Versions Maven Plugin provides a means to update version information in a Maven project
-The current implementation of
-
- DefaultArtifactVersion
-
- in the core of Maven expects that version numbers will have a very
- specific format:
-
- MajorVersion [
- .
- MinorVersion [
- .
- IncrementalVersion ] ] [
- -
- BuildNumber | Qualifier ]
-
WhereMajorVersion,MinorVersion,IncrementalVersion, and - BuildNumber - are all - numeric and - Qualifier - is a string. If your version number does not match this format, then the entire - version number is treated as being theQualifier. -
-Version numbers in maven are compared using the individual components, soMajorVersion,
- MinorVersion,IncrementalVersion, and
- BuildNumber
- are all compared asInteger
s
- while
- Qualifier
- is compared as aString
.
-
From the above you may have guessed neither
- 1.0.0.9
- nor
- 1.0.0.23
- match the exact
- format that Maven expects, and as a result they are mapped as being just aQualifier.
- String comparison will sort
- 1.0.0.9
- >1.0.0.23
.
-
If you need version numbers to be sorted "correctly" you will need to define some - - version number comparison rules - . -
-- In order to determine what versions of an artifact are present, Maven relies on the presence of - meta-data files in the repository. If the meta-data files are missing or contain invalid information - then Maven will not know about versions that are available in your repositories. -
-- Here are some common reasons why your metadata can be invalid: -
-- In most cases, using a repository manager will solve these issues as the repository managers usually - rebuild the metadata files based on the artifacts that are present. -
-