You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Joerg Schaible (JIRA)" <ji...@codehaus.org> on 2009/12/28 12:29:55 UTC

[jira] Closed: (MNG-2323) Locked SNAPSHOT version ignored

     [ http://jira.codehaus.org/browse/MNG-2323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joerg Schaible closed MNG-2323.
-------------------------------

    Resolution: Cannot Reproduce

This bug has been reported for Maven 2.0.4. The primary issue that 2.0.1 is preferred over 2.0-SNAPSHOT was caused by wrong assumptions about the Maven depednency resoluation and is invalid. The last comment about 1.99 preferred over 2.0-SNAPSHOT might no longer apply, there had been a lot of changes over the last 3 years.

> Locked SNAPSHOT version ignored
> -------------------------------
>
>                 Key: MNG-2323
>                 URL: http://jira.codehaus.org/browse/MNG-2323
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.4, 3.0-alpha-7
>            Reporter: Joerg Schaible
>            Priority: Critical
>             Fix For: 3.0-alpha-7
>
>
> We use for our tip revision (head revision of a branch) a snapshot version in the form of:
> _major.minor-SNAPSHOT_
> If we make a (maintenance) release, we create a version like:
> _major.minor.revision_
> We manage our dependencies in a dependencyManagement section of a super POM, where we define always the last released version of an artifact. A dependency of an artifact that is always declared without explicit version unless it makes usage of an unreleased version, then the child POM will be changed from
> {code:xml}
> <dependency>
>   <groupId>group</group>
>   <artifactId>artifact</artifactId>
> <dependency>
> {code}
> to 
> {code:xml}
> <dependency>
>   <groupId>group</group>
>   <artifactId>artifact</artifactId>
>   <version>major.minor-SNAPSHOT</version>
> <dependency>
> {code}
> Unfortunately this does not work, Maven still prefers the released version. Here in the example 2.0.0 instead of 2.0.-SNAPSHOT (snippet):
> {noformat}
> [INFO] [eclipse:eclipse]
> [DEBUG] com.elsagsolutions.projects.components:es_logging:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG]   com.elsagsolutions.commons:es_commons_test:jar:2.0-SNAPSHOT:test (applying version: 2.0.0;applying scope: test)
> [DEBUG]   com.elsagsolutions.commons:es_commons_test:jar:2.0.0:test (selected for test)
> [DEBUG]     cglib:cglib-nodep:jar:2.1_3:test (applying version: 2.1_3;)
> [DEBUG]     cglib:cglib-nodep:jar:2.1_3:test (selected for test)
> {noformat}
> But it gets worse. Even if we try to lock the version in the child POM, it does not work; the locked version is happily ignored:
> {code:xml}
> <dependency>
>   <groupId>group</group>
>   <artifactId>artifact</artifactId>
>   <version>[major.minor-SNAPSHOT]</version>
> <dependency>
> {code}
> Output from the example:
> {noformat}
> [INFO] [eclipse:eclipse]
> [DEBUG] com.elsagsolutions.projects.components:es_logging:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG]   com.elsagsolutions.commons:es_commons_test:jar:2.0-SNAPSHOT:test (setting version to: 2.0-SNAPSHOT from range: [2.0-SNAPSHOT,2.0-SNAPSHOT])
> [DEBUG]   com.elsagsolutions.commons:es_commons_test:jar:2.0-SNAPSHOT:test (applying version: 2.0.0;applying scope: test)
> [DEBUG]   com.elsagsolutions.commons:es_commons_test:jar:2.0.0:test (selected for test)
> [DEBUG]     cglib:cglib-nodep:jar:2.1_3:test (applying version: 2.1_3;)
> [DEBUG]     cglib:cglib-nodep:jar:2.1_3:test (selected for test)
> {noformat}
> First problem is, that 2.0.x is treated as nearer as 2.0-SNAPSHOT. This is IMHO wrong. The algorithm should look, at which point in the version numbering the SNAPSHOT part starts and ignore the further numbers in the version of released artifacts. Additionally the locked version must be honored in any case.

-- 
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