You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Simon Kitching <si...@chello.at> on 2008/02/11 16:50:51 UTC
Weird behaviour with dependency range
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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: Weird behaviour with dependency range
Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Looks like the same npe as MNG-3372 and MNG-3351
-----Original Message-----
From: Simon Kitching [mailto:simon.kitching@chello.at]
Sent: Monday, February 11, 2008 7:51 AM
To: users@maven.apache.org
Subject: Weird behaviour with dependency range
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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org