You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Yann LE DU <ya...@orange.fr> on 2005/07/19 15:59:10 UTC

[m2] DefaultArtifactVersion fails on non-numeral versions

Hi,

Working with m2-beta-1 build of revision 219633.

When I launch the "install" goal, if the version of one
of my project dependency contains non-numeral
characters, I got the following error. It happens on my
project (on swarmcache:swarmcache:1.0RC2), but also
when I build Continuum (on jta:jta:1.0.1b)

java.lang.NumberFormatException: For input string: "0RC2"
        at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
        at java.lang.Integer.parseInt(Integer.java:477)
        at java.lang.Integer.valueOf(Integer.java:574)
        at
org.apache.maven.artifact.versioning.DefaultArtifactVersion.parseVersion(DefaultArtifactVersion.java:192)
        at
org.apache.maven.artifact.versioning.DefaultArtifactVersion.<init>(DefaultArtifactVersion.java:42)
        at
org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec(VersionRange.java:112)
...


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [m2] DefaultArtifactVersion fails on non-numeral versions

Posted by Brett Porter <br...@apache.org>.
Ok, sorry about that.

What I will do with these is fallback to a string comparison for the 
*whole* version.

- Brett

Yann LE DU wrote:

>Hi,
>
>Working with m2-beta-1 build of revision 219633.
>
>When I launch the "install" goal, if the version of one
>of my project dependency contains non-numeral
>characters, I got the following error. It happens on my
>
>project (on swarmcache:swarmcache:1.0RC2), but also
>when I build Continuum (on jta:jta:1.0.1b)
>
>java.lang.NumberFormatException: For input string: "0RC2"
>        at
>java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
>        at java.lang.Integer.parseInt(Integer.java:477)
>        at java.lang.Integer.valueOf(Integer.java:574)
>        at
>org.apache.maven.artifact.versioning.DefaultArtifactVersion.parseVersion(DefaultArtifactVersion.java:192)
>        at
>org.apache.maven.artifact.versioning.DefaultArtifactVersion.<init>(DefaultArtifactVersion.java:42)
>        at
>org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec(VersionRange.java:112)
>...
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>For additional commands, e-mail: dev-help@maven.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org