You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Paul Gier (JIRA)" <ji...@codehaus.org> on 2009/04/18 16:09:44 UTC

[jira] Commented: (MNG-4138) Version range of a dependency is not available if the dependency is found transitively.

    [ http://jira.codehaus.org/browse/MNG-4138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173408#action_173408 ] 

Paul Gier commented on MNG-4138:
--------------------------------

This also occurs when using dependencies retrieved from {{project.getDependencies()}}.  In one the first case, {{dependency.getVersion()}} returns the range, in the second situation, {{dependency.getVersion()}} returns the resolved version.

Also this only happens when the transitive dependency fits in the range of the direct dep.  If the transitive dependency is outside the range specified, then the range is available using {{dependency.getVersion()}} or {{artifact.getVersionRange()}}.

> Version range of a dependency is not available if the dependency is found transitively.
> ---------------------------------------------------------------------------------------
>
>                 Key: MNG-4138
>                 URL: http://jira.codehaus.org/browse/MNG-4138
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.10, 2.1.0
>            Reporter: Paul Gier
>
> The behaviour is like this:
> If I have a pom with a single dependency with a version range like this.
> {code:xml} 
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>[3.0, 3.8.2)</version>
>     </dependency>
> {code}
> I can access the version range using the resolved dependency artifact.
> {code:java} 
> Set artifacts = project.getDependencyArtifacts();
> artifact.getVersionRange();
> {code} 
> If the same dependency is picked up transitively from another dependency, for example junit is a trasitive dependency of maven-project:
> {code:xml}
>     <dependency>
>       <groupId>org.apache.maven</groupId>
>       <artifactId>maven-project</artifactId>
>       <version>2.0.8</version>
>     </dependency>
>     
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>[3.0, 3.8.2)</version>
>     </dependency>
> {code}
> Now the VersionRange object is returned, but it only contains the resolved version.  For example "3.8.1".

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira