You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Fabrice BELLINGARD (JIRA)" <ji...@codehaus.org> on 2007/01/26 09:53:45 UTC

[jira] Created: (MNG-2794) Transitive dependency resolution differs between 2.0.4 and 2.0.5

Transitive dependency resolution differs between 2.0.4 and 2.0.5
----------------------------------------------------------------

                 Key: MNG-2794
                 URL: http://jira.codehaus.org/browse/MNG-2794
             Project: Maven 2
          Issue Type: Bug
          Components: Dependencies
    Affects Versions: 2.0.4
            Reporter: Fabrice BELLINGARD
         Attachments: Test-DependencyResolution.zip

Say you have a project that has 3 dependecies A, B and C, amongst which 2 of them have a dependency D but with a different version:
  A -> D v2.1
  B -> D v3
  C (has no transitive dependency to D)
In the project, you call a class that exists in D v3 but not in D v2.1. 

-> If you launch "mvn clean compile" with M2.0.4, the build is successful, but not with M2.0.5.

And the most surprising: if you remove dependency C, then both builds break...

I attached a test project that reproduces the bug.

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

        

[jira] Commented: (MNG-2794) Transitive dependency resolution differs between 2.0.4 and (future) 2.0.5

Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_87295 ] 

Jason van Zyl commented on MNG-2794:
------------------------------------

After looking at this specific case, you are doing something that we do not recommend. If the project you are working has a direct dependency which you require for compilation then you should be specifying it. I realize something has changed, but you should be specifying. And the behavior in 2.0.5 is actually more correct according to our select the nearest strategy. If you rearrange the dependencies and put the dependency that has a dependency on commons-collections 3.0 then the builds works fine. 

> Transitive dependency resolution differs between 2.0.4 and (future) 2.0.5
> -------------------------------------------------------------------------
>
>                 Key: MNG-2794
>                 URL: http://jira.codehaus.org/browse/MNG-2794
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.5
>            Reporter: Fabrice BELLINGARD
>             Fix For: 2.0.5
>
>         Attachments: Test-DependencyResolution.zip
>
>
> Say you have a project that has 3 dependecies A, B and C, amongst which 2 of them have a dependency D but with a different version:
>   A -> D v2.1
>   B -> D v3
>   C (has no transitive dependency to D)
> In the project, you call a class that exists in D v3 but not in D v2.1. 
> -> If you launch "mvn clean compile" with M2.0.4, the build is successful, but not with M2.0.5.
> And the most surprising: if you remove dependency C, then both builds break...
> I attached a test project that reproduces the bug.

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

        

[jira] Commented: (MNG-2794) Transitive dependency resolution differs between 2.0.4 and (future) 2.0.5

Posted by "nicolas de loof (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_87178 ] 

nicolas de loof commented on MNG-2794:
--------------------------------------

Maven 2.0.4 uses the "nearest" strategy to solve dependency conflicts, so the issue
 "
 project depends on A -> D-v2
 project depends on B -> D-v3
 "

has no determinist solution about what version of D will be transitively used. Having this work in maven 2.0.4 in some circonstances is only beeing lucky. If your project depends on classes from D v3, you should declare it as a dependency to solve the conflict.

there is some plan to enhance the resolution strategy with  (http://docs.codehaus.org/display/MAVENUSER/Improving+Maven2+Dependency+Resolution)
but AFAIK the target is maven 2.1.

> Transitive dependency resolution differs between 2.0.4 and (future) 2.0.5
> -------------------------------------------------------------------------
>
>                 Key: MNG-2794
>                 URL: http://jira.codehaus.org/browse/MNG-2794
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.5
>            Reporter: Fabrice BELLINGARD
>             Fix For: 2.0.5
>
>         Attachments: Test-DependencyResolution.zip
>
>
> Say you have a project that has 3 dependecies A, B and C, amongst which 2 of them have a dependency D but with a different version:
>   A -> D v2.1
>   B -> D v3
>   C (has no transitive dependency to D)
> In the project, you call a class that exists in D v3 but not in D v2.1. 
> -> If you launch "mvn clean compile" with M2.0.4, the build is successful, but not with M2.0.5.
> And the most surprising: if you remove dependency C, then both builds break...
> I attached a test project that reproduces the bug.

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

        

[jira] Closed: (MNG-2794) Transitive dependency resolution differs between 2.0.4 and (future) 2.0.5

Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2794?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason van Zyl closed MNG-2794.
------------------------------

    Resolution: Won't Fix

The behavior in 2.0.5 is correct and is the behavior we actually have documented.

> Transitive dependency resolution differs between 2.0.4 and (future) 2.0.5
> -------------------------------------------------------------------------
>
>                 Key: MNG-2794
>                 URL: http://jira.codehaus.org/browse/MNG-2794
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.5
>            Reporter: Fabrice BELLINGARD
>             Fix For: 2.0.5
>
>         Attachments: Test-DependencyResolution.zip
>
>
> Say you have a project that has 3 dependecies A, B and C, amongst which 2 of them have a dependency D but with a different version:
>   A -> D v2.1
>   B -> D v3
>   C (has no transitive dependency to D)
> In the project, you call a class that exists in D v3 but not in D v2.1. 
> -> If you launch "mvn clean compile" with M2.0.4, the build is successful, but not with M2.0.5.
> And the most surprising: if you remove dependency C, then both builds break...
> I attached a test project that reproduces the bug.

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

        

[jira] Updated: (MNG-2794) Transitive dependency resolution differs between 2.0.4 and (future) 2.0.5

Posted by "Fabrice BELLINGARD (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2794?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fabrice BELLINGARD updated MNG-2794:
------------------------------------

    Affects Version/s:     (was: 2.0.4)
                       2.0.5

> Transitive dependency resolution differs between 2.0.4 and (future) 2.0.5
> -------------------------------------------------------------------------
>
>                 Key: MNG-2794
>                 URL: http://jira.codehaus.org/browse/MNG-2794
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.5
>            Reporter: Fabrice BELLINGARD
>         Attachments: Test-DependencyResolution.zip
>
>
> Say you have a project that has 3 dependecies A, B and C, amongst which 2 of them have a dependency D but with a different version:
>   A -> D v2.1
>   B -> D v3
>   C (has no transitive dependency to D)
> In the project, you call a class that exists in D v3 but not in D v2.1. 
> -> If you launch "mvn clean compile" with M2.0.4, the build is successful, but not with M2.0.5.
> And the most surprising: if you remove dependency C, then both builds break...
> I attached a test project that reproduces the bug.

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

        

[jira] Updated: (MNG-2794) Transitive dependency resolution differs between 2.0.4 and (future) 2.0.5

Posted by "Emmanuel Venisse (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2794?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Venisse updated MNG-2794:
----------------------------------

    Fix Version/s: 2.0.5

> Transitive dependency resolution differs between 2.0.4 and (future) 2.0.5
> -------------------------------------------------------------------------
>
>                 Key: MNG-2794
>                 URL: http://jira.codehaus.org/browse/MNG-2794
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.5
>            Reporter: Fabrice BELLINGARD
>             Fix For: 2.0.5
>
>         Attachments: Test-DependencyResolution.zip
>
>
> Say you have a project that has 3 dependecies A, B and C, amongst which 2 of them have a dependency D but with a different version:
>   A -> D v2.1
>   B -> D v3
>   C (has no transitive dependency to D)
> In the project, you call a class that exists in D v3 but not in D v2.1. 
> -> If you launch "mvn clean compile" with M2.0.4, the build is successful, but not with M2.0.5.
> And the most surprising: if you remove dependency C, then both builds break...
> I attached a test project that reproduces the bug.

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

        

[jira] Updated: (MNG-2794) Transitive dependency resolution differs between 2.0.4 and (future) 2.0.5

Posted by "Fabrice BELLINGARD (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2794?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fabrice BELLINGARD updated MNG-2794:
------------------------------------

    Summary: Transitive dependency resolution differs between 2.0.4 and (future) 2.0.5  (was: Transitive dependency resolution differs between 2.0.4 and 2.0.5)

> Transitive dependency resolution differs between 2.0.4 and (future) 2.0.5
> -------------------------------------------------------------------------
>
>                 Key: MNG-2794
>                 URL: http://jira.codehaus.org/browse/MNG-2794
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.4
>            Reporter: Fabrice BELLINGARD
>         Attachments: Test-DependencyResolution.zip
>
>
> Say you have a project that has 3 dependecies A, B and C, amongst which 2 of them have a dependency D but with a different version:
>   A -> D v2.1
>   B -> D v3
>   C (has no transitive dependency to D)
> In the project, you call a class that exists in D v3 but not in D v2.1. 
> -> If you launch "mvn clean compile" with M2.0.4, the build is successful, but not with M2.0.5.
> And the most surprising: if you remove dependency C, then both builds break...
> I attached a test project that reproduces the bug.

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

        

[jira] Commented: (MNG-2794) Transitive dependency resolution differs between 2.0.4 and (future) 2.0.5

Posted by "Rodrigo Ruiz (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_87183 ] 

Rodrigo Ruiz commented on MNG-2794:
-----------------------------------

Hi Nicolas,

So, the problem is that Maven 2.0.4 and 2.0.5 bahave different when the dependency information has errors!? If the "workaround" is to correct the POM, shouldn't this be a "will not be resolved" case?

> Transitive dependency resolution differs between 2.0.4 and (future) 2.0.5
> -------------------------------------------------------------------------
>
>                 Key: MNG-2794
>                 URL: http://jira.codehaus.org/browse/MNG-2794
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.0.5
>            Reporter: Fabrice BELLINGARD
>             Fix For: 2.0.5
>
>         Attachments: Test-DependencyResolution.zip
>
>
> Say you have a project that has 3 dependecies A, B and C, amongst which 2 of them have a dependency D but with a different version:
>   A -> D v2.1
>   B -> D v3
>   C (has no transitive dependency to D)
> In the project, you call a class that exists in D v3 but not in D v2.1. 
> -> If you launch "mvn clean compile" with M2.0.4, the build is successful, but not with M2.0.5.
> And the most surprising: if you remove dependency C, then both builds break...
> I attached a test project that reproduces the bug.

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