Hi,

I've run across something very odd with dependency ranges.

Maven version: 2.0.8
java: 1.6

If I put this in my pom
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>[1.0.9]</version>
    </dependency>
then run dependency:tree I get an error:

<output>
Couldn't find a version in [1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.1, 1.1.1, 
1.1.1-SNAPSHOT] to match range [1.0.9,1.0.9]
</output>

So far so good. But if I change this to 1.0.1, I get this:

java.lang.NullPointerException: version was null for 
commons-logging:commons-logging
        at 
org.apache.maven.artifact.DefaultArtifact.getBaseVersion(DefaultArtifact.java:362)
        at 
org.apache.maven.artifact.DefaultArtifact.getId(DefaultArtifact.java:225)


Any idea what is going on here?

The initial problem I struck was even subtler; a parent pom was using 
dependencyManagement to set the version. I tried to override in the child pom 
but dependency:tree was still reporting the version defined in the parent.

It looks like [version] fails correctly when the version does not exist, but is 
silently ignored when the version actually exists.

The same thing happens for [1.0,1.1.1) and similar ranges.

Regards,
Simon

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to