Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Duplicate
-
Affects Version/s: 2.0.4
-
Fix Version/s: None
-
Component/s: Dependencies
-
Labels:None
-
Environment:Windows XP, Sun JDK 5.0 Update 7
-
Complexity:Intermediate
-
Number of attachments :
Description
When a repository is configured (POM, profiles, etc), 'releases' is disabled, 'snapshots' is enabled and a dependency uses a version range, the dependency fails to resolve. The dependency is found when an explicit version is used. The following can be used to recreate the issue.
Setup the maven snapshot repository in an active profile like this:
<repository>
<id>apache.snapshots</id>
<name>Maven Snapshots</name>
<url>http://people.apache.org/maven-snapshot-repository</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
Check out the maven-install-plugin at revision 427494 (or any revision or other plugin that has a dependency that's a SNAPSHOT). Run a build (mvn package) and all dependencies should download. Modify the dependency in the POM to use a version range, instead of an explict version. For example, change the version "1.0-SNAPSHOT" to "[0,1)", which includes the same version. Run another build (mvn package) and the dependency will fail to download.
I'm sure that this has been filed elsewhere - would be worth checking for dupes.