Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0-alpha-1
-
Fix Version/s: 2.0.9
-
Component/s: Artifacts and Repositories
-
Labels:None
-
Environment:Java5, WinXp
-
Complexity:Intermediate
-
Number of attachments :
Description
In class org.apache.maven.artifact.DefaultArtifact method getVersionRange returns null altough the version field is already set. In attached patch I check in method getVersionRange if versionRange is null if field version or baseVersion is already set and then create the versionRange by using version/baseVersion. By the way I've replaced HashMap with a LinkedHashMap to remember the insertion order of meta data.
For those who don't see why this patch is needed can try binding the eclipse plugin to a phase before the jar plugin is bound. The eclipse plugin uses the org.apache.maven.artifact.resolver.DefaultArtifactCollector which is invoking method setVersion of org.apache.maven.artifact.DefaultArtifact which will erase field version range and cause a NullPointerException in plugin jar that doesn't check if returned version range is null.
Cheers,
Martin
I suspect this is already fixed. Can you reproduce?