jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x Eclipse Plugin
  • MECLIPSE-348

Transitive dependencies are resolved in an inhomogeneous manner

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Critical Critical
  • Resolution: Unresolved
  • Affects Version/s: 2.4
  • Fix Version/s: None
  • Component/s: Core : Dependencies resolution and build path (.classpath)
  • Labels:
    None
  • Environment:
    Maven 2.0.7, Windows XP SP 2, JDK 1.5.0
  • Testcase included:
    yes

Description

There are four modules/projects moduleA, moduleB, moduleC and moduleD.

moduleA depends on moduleB-1.0.jar
moduleC depends on moduleB-2.0.jar
moduleD depends on moduleC-1.0.jar and moduleA-1.0.jar

What constellation has to be built if I build moduleD-1.0.jar without explicit dependency management?

In my opinion D should be built with A-1.0.jar, B-2.0.jar, C-1.0.jar and (hopefully) A-1.0.jar can also run with this version.
This even happens with the common mvn goals like e.g. mvn test:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running AppTest
call me from modulD
call me from modulC
call me from modulB - Version 2.0
call me from modulA
call me from modulB - Version 2.0

But with mvn eclipse:eclipse I will get the following classpathentries:
<classpathentry kind="var" path="M2_REPO/.../modulA/1.0/modulA-1.0.jar"/>
<classpathentry kind="var" path="M2_REPO/.../modulB/1.0/modulB-1.0.jar"/>
<classpathentry kind="var" path="M2_REPO/.../modulC/1.0/modulC-1.0.jar"/>

That's inhomogenous.
What can I do to resolve it (without dependency management, of course)?

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    module.zip
    21/Nov/07 6:34 AM
    106 kB
    Michael Albrecht
    1. XML File
      modulA/pom.xml 0.8 kB
    2. Java Source File
      modulA/src/main/.../beispiel/AppA.java 0.4 kB
    3. Java Source File
      modulA/src/test/.../beispiel/AppTest.java 0.6 kB
    4. File
      modulA/.../mvn-eclipse-cache.properties 0.1 kB
    5. File
      modulA/target/.../beispiel/AppA.class 0.7 kB
    6. File
      modulA/target/.../beispiel/AppTest.class 0.6 kB
    7. Text File
      modulA/.../de.mavenbuch.beispiel.AppTest.txt 0.3 kB
    8. XML File
      modulA/.../TEST-de.mavenbuch.beispiel.AppTest.xml 5 kB
    9. Java Archive File
      modulA/target/modulA-1.0-SNAPSHOT.jar 2 kB
    10. Java Archive File
      modulA/target/modulA-1.0.jar 2 kB
    11. HTML File
      modulA/target/site/integration.html 4 kB
    12. HTML File
      modulA/target/site/dependencies.html 5 kB
    13. HTML File
      modulA/target/site/issue-tracking.html 4 kB
    14. HTML File
      modulA/target/site/license.html 3 kB
    15. HTML File
      modulA/target/site/mail-lists.html 4 kB
    16. HTML File
      modulA/target/site/index.html 3 kB
    17. HTML File
      modulA/target/site/project-summary.html 4 kB
    18. HTML File
      modulA/target/.../source-repository.html 4 kB
    19. HTML File
      modulA/target/site/team-list.html 5 kB
    20. HTML File
      modulA/target/site/project-info.html 5 kB
    21. File
      modulA/target/site/css/maven-theme.css 3 kB
    22. File
      modulA/target/site/css/maven-base.css 2 kB
    23. File
      modulA/target/site/css/print.css 0.2 kB
    24. PNG File
      modulA/target/site/images/external.png 0.2 kB
    25. GIF File
      modulA/target/.../images/icon_error_sml.gif 1.0 kB
    26. GIF File
      modulA/target/.../images/icon_info_sml.gif 0.6 kB
    27. GIF File
      modulA/target/.../icon_success_sml.gif 1.0 kB
    28. GIF File
      modulA/target/.../icon_warning_sml.gif 0.6 kB
    29. PNG File
      modulA/target/site/images/newwindow.png 0.2 kB
    30. GIF File
      modulA/target/site/images/expanded.gif 0.1 kB
    Showing 30 of 109 items Download Zip
    Show
    Zip Archive
    module.zip
    21/Nov/07 6:34 AM
    106 kB
    Michael Albrecht

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Arnaud Heritier added a comment - 21/Nov/07 11:10 AM

I reproduced your problem
There's certainly a bug in the dependency resolution strategy used by the plugin

Show
Arnaud Heritier added a comment - 21/Nov/07 11:10 AM I reproduced your problem There's certainly a bug in the dependency resolution strategy used by the plugin
Hide
Permalink
Jason Tholstrup added a comment - 17/Feb/09 2:05 PM

I'd just like to see where you guys are at with this one. I see it is listed as critical but the last status on it is from 2007. I can verify that I too see this issue, and I also have a little more info to provide on it.

I have project1 and project2.

project -> dependencies
----------------------------------
project1 -> project2, dependency-1.0
project2 -> dependency-1.1

Here I will resolve get dependency-1.1 when I look at the dependency hierarchy.

======

If however I flip the order of the dependencies in project1.....

project -> dependencies
----------------------------------
project1 -> dependency-1.0, project2
project2 -> dependency-1.1

I get dependency-1.0. It looks as if the resolver is doing a depth first search and just taking the first version it comes to.

=======

It would be great if we could see a resolution on this one as I think this is exactly why a lot of us use maven. If nothing else I hope my notes above might provide a work around for others though if you have a very complex pom structure it might cause more problems than it solves.

Show
Jason Tholstrup added a comment - 17/Feb/09 2:05 PM I'd just like to see where you guys are at with this one. I see it is listed as critical but the last status on it is from 2007. I can verify that I too see this issue, and I also have a little more info to provide on it. I have project1 and project2. project -> dependencies ---------------------------------- project1 -> project2, dependency-1.0 project2 -> dependency-1.1 Here I will resolve get dependency-1.1 when I look at the dependency hierarchy. ====== If however I flip the order of the dependencies in project1..... project -> dependencies ---------------------------------- project1 -> dependency-1.0, project2 project2 -> dependency-1.1 I get dependency-1.0. It looks as if the resolver is doing a depth first search and just taking the first version it comes to. ======= It would be great if we could see a resolution on this one as I think this is exactly why a lot of us use maven. If nothing else I hope my notes above might provide a work around for others though if you have a very complex pom structure it might cause more problems than it solves.
Hide
Permalink
Michael Albrecht added a comment - 18/Feb/09 1:04 AM

"It looks as if the resolver is doing a depth first search and just taking the first version it comes to."

This is exactly the documented behaviour from Maven, but the maven-eclipse-plugin does it in another way.
I thought that's the problem.

Show
Michael Albrecht added a comment - 18/Feb/09 1:04 AM "It looks as if the resolver is doing a depth first search and just taking the first version it comes to." This is exactly the documented behaviour from Maven, but the maven-eclipse-plugin does it in another way. I thought that's the problem.
Hide
Permalink
Jason Tholstrup added a comment - 18/Feb/09 10:11 AM

I must be confused somewhere here then. I thought the expected behavior was to get the highest version of the jar that was required. So if in your dependency graph you required (v1, v1.1, and v2), v2 should be returned regardless of the order the dependency walker found them.

Where are you finding this documented maven behavior? I've always found it difficult to navigate through their documentation. To be clear here I'm not trying to argue with you I'm just trying to figure out if this is a bug or if it is a enhancement request and who I should direct the request to (Maven 2.x Eclipse Plugin, m2eclipe, or maven).

And just as a point of information for myself: I am a bit confused as to the difference between Maven 2.x Eclipse Plugin and m2eclipse. It'd be good to understand the community's organization so I don't pester the wrong people with my stupid questions.

Show
Jason Tholstrup added a comment - 18/Feb/09 10:11 AM I must be confused somewhere here then. I thought the expected behavior was to get the highest version of the jar that was required. So if in your dependency graph you required (v1, v1.1, and v2), v2 should be returned regardless of the order the dependency walker found them. Where are you finding this documented maven behavior? I've always found it difficult to navigate through their documentation. To be clear here I'm not trying to argue with you I'm just trying to figure out if this is a bug or if it is a enhancement request and who I should direct the request to (Maven 2.x Eclipse Plugin, m2eclipe, or maven). And just as a point of information for myself: I am a bit confused as to the difference between Maven 2.x Eclipse Plugin and m2eclipse. It'd be good to understand the community's organization so I don't pester the wrong people with my stupid questions.
Hide
Permalink
Michael Albrecht added a comment - 19/Feb/09 11:16 AM

The truth?! Ok, I thought it in your way, too, but Maven documentation disabused me.
s. http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

After all that reading and thinking over I'm sure it's the better way to do in it a graph and get the nearest definition.
The nearer the definition is the merrier it is, isn't and if you want the "latest and highest" version number.
You can set it by interval terms, e.g. [2.5, )

The solution we both thought should be the right is fatal and corrupt.

Think about it

Show
Michael Albrecht added a comment - 19/Feb/09 11:16 AM The truth?! Ok, I thought it in your way, too, but Maven documentation disabused me. s. http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html After all that reading and thinking over I'm sure it's the better way to do in it a graph and get the nearest definition. The nearer the definition is the merrier it is, isn't and if you want the "latest and highest" version number. You can set it by interval terms, e.g. [2.5, ) The solution we both thought should be the right is fatal and corrupt. Think about it

People

  • Assignee:
    Unassigned
    Reporter:
    Michael Albrecht
Vote (2)
Watch (3)

Dates

  • Created:
    21/Nov/07 6:34 AM
    Updated:
    19/Feb/09 11:16 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.