Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.7
-
Fix Version/s: None
-
Labels:None
-
Number of attachments :
Description
Although the most popular version format is major.minor.incremental, there are other widely used version formats. For instance, Google App Engine and Android projects use a simple integer, e.g. 1, 77, and 888. In these cases, you'd like $
{parsedVersion.majorVersion}to return that entire value, either 1, 77, or 888. However, currently only the first digit from each version component is returned,
Please enhance the parse-version goal to return all the digits in each component of $
{project.version}.
After further experimenting, I found my initial problem description was partly incorrect and not complete. If I use non-zero digits in my version, such as 77, then the parse-version goal correctly returns majorVersion of 77.
However if my version format is 006, then the majorVersion returned is 0.
You may ask why I left pad my version with zeros. If I don't, then when the file system sorts release in my Maven repository, they'll be out of order. Without zero padding, release are sorted like this:
1
10
11
2
...
But I want:
1
2
3
...
10
11
Therefore, I must use left zero padding to get this:
01
02
...
10
11