Issue Details (XML | Word | Printable)

Key: MRM-1172
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Maria Odea Ching
Reporter: Wendy Smoak
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Archiva

Invalid version validation error when uploading a jar with a four-part version number

Created: 15/Apr/09 03:34 PM   Updated: 02/Oct/09 04:38 PM   Resolved: 24/May/09 06:43 AM
Return to search
Component/s: web application
Affects Version/s: 1.2.1
Fix Version/s: 1.2.1

Time Tracking:
Not Specified

File Attachments: 1. Text File MRM-1172-2.patch (3 kB)
2. Text File MRM-1172.patch (0.7 kB)

Environment: Archiva 1.2.1-SNAPSHOT trunk r761865
Issue Links:
Related
 


 Description  « Hide

Archiva will not allow you to upload an artifact with a version number in the format 2.5-r123456-proj-1.2.3

We use this version number format to do internal releases of third-party artifacts.

Deploying from the command line works, but the artifact upload form in Archiva will not accept this version number and displays "Invalid version".



Brett Porter made changes - 15/Apr/09 03:39 PM
Field Original Value New Value
Fix Version/s 1.2.1 [ 15108 ]
Wendy Smoak made changes - 15/Apr/09 03:40 PM
Environment Archiva 1.2.1-SNAPSHOT trunk r761865
jan ancajas added a comment - 27/Apr/09 03:02 AM

From what I've traced this has something to do with the version algorithm implementation :
1. tokenize the string using "-" (dash) as the separator
2. checks if each token matches the regex pattern (see below)
3. the token ratio between "matching tokens" and "all tokens" must be 75% or more.

From the example it's only 50%.

We can loosen the rule a bit to return true if the first token is a matching token. thoughts on this ?

        "([0-9][_.0-9a-z]*)",
        "(snapshot)",
        "(g?[_.0-9ab]*(pre|rc|g|m)[_.0-9]*)",
        "(dev[_.0-9]*)",
        "(alpha[_.0-9]*)",
        "(beta[_.0-9]*)",
        "(rc[_.0-9]*)",
        "(debug[_.0-9]*)",
        "(unofficial[_.0-9]*)",
        "(current)",
        "(latest)",
        "(fcs)",
        "(release[_.0-9]*)",
        "(nightly)",
        "(final)",
        "(incubating)",
        "(incubator)",
        "([ab][_.0-9]+)"

jan ancajas added a comment - 27/Apr/09 03:38 AM

attach patch for the proposed solution.


jan ancajas made changes - 27/Apr/09 03:38 AM
Attachment MRM-1172.patch [ 41616 ]
Wendy Smoak added a comment - 27/Apr/09 09:17 AM

Is there logic somewhere in Maven to decide whether a version number is valid? Why would Archiva be more strict about this?

I've never had a build fail due to an invalid version number... it may not be able to find the dependency, and creative version number formats don't work well with ranges, but not invalid.


jan ancajas added a comment - 28/Apr/09 08:55 PM

maven deploy plugin doesn't have this checking. it's only in archiva


jan ancajas added a comment - 06/May/09 03:06 AM

added UT. THanks


jan ancajas made changes - 06/May/09 03:06 AM
Attachment MRM-1172-2.patch [ 41794 ]
Maria Odea Ching added a comment - 06/May/09 06:21 AM

Patch applied to trunk -r772151. Thanks Jan!

Leaving this issue for the documentation patch..


Maria Odea Ching made changes - 24/May/09 06:43 AM
Assignee Maria Odea Ching [ oching ]
Maria Odea Ching added a comment - 24/May/09 06:43 AM

Updated documentation in trunk -r778123.


Maria Odea Ching made changes - 24/May/09 06:43 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]
Justin Rennell made changes - 02/Oct/09 04:38 PM
Link This issue relates to MRM-964 [ MRM-964 ]