Issue Details (XML | Word | Printable)

Key: MECLIPSE-472
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Unassigned
Reporter: Olivier Lamy
Votes: 10
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Maven 2.x Eclipse Plugin

Bad dependencies (version & list) in .classpath whereas compilation (and dependency:tree) use the rigth one

Created: 25/Jul/08 06:16 PM   Updated: 15/Jan/10 08:52 AM
Return to search
Component/s: Core : Dependencies resolution and build path (.classpath)
Affects Version/s: 2.5.1
Fix Version/s: 2.8

Time Tracking:
Not Specified

File Attachments: 1. Text File war_with_implicit_scopes.patch (5 kB)

Image Attachments:

1. screenshot-1.jpg
(126 kB)
Issue Links:
Related
 


 Description  « Hide

Maven compilation and dependency:tree display org/codehaus/plexus/plexus-component-api/1.0-alpha-20/plexus-component-api-1.0-alpha-20
Whereas the generated .classpath contains <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar"/>
Related continuum dev email http://continuum.markmail.org/message/6eiyt6vgdqycc4hm?q=

Step to reproduce :

svn co -r679899 https://svn.apache.org/repos/asf/continuum/trunk continuum && cd continuum && mvn eclipse:eclipse &&grep plexus-compone continuum-core/.classpath

.....

  <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.jar"/>


Arnaud Heritier added a comment - 01/Aug/08 09:47 AM

The number of dependencies is also wrong.
For example, we have a project with those dependencies :

[INFO] [dependency:list]
[INFO] 
[INFO] The following files have been resolved:
[INFO]    com.sun.facelets:jsf-facelets:jar:1.1.14:compile
[INFO]    commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO]    commons-digester:commons-digester:jar:1.8:compile
[INFO]    javax.persistence:persistence-api:jar:1.0:provided
[INFO]    junit:junit:jar:3.8.1:test
[INFO]    org.jboss.el:jboss-el:jar:2.0.1.GA:compile
[INFO]    org.jboss.seam:jboss-seam:jar:2.0.2.SP1:compile
[INFO]    org.jboss.seam:jboss-seam-debug:jar:2.0.2.SP1:compile
[INFO]    org.jboss.seam:jboss-seam-ui:jar:2.0.2.SP1:compile
[INFO]    org.richfaces.framework:richfaces-api:jar:3.1.4.GA:compile
[INFO]    org.richfaces.framework:richfaces-impl:jar:3.1.4.GA:compile
[INFO]    org.richfaces.ui:richfaces-ui:jar:3.1.4.GA:compile
[INFO]    org.testng:testng:jar:jdk15:5.8:test

The tree of dependencies is :

[INFO] [dependency:tree]
[INFO] fr.test.seam.archetype.simple:web:war:1.0-SNAPSHOT
[INFO] +- com.sun.facelets:jsf-facelets:jar:1.1.14:compile
[INFO] +- org.richfaces.framework:richfaces-api:jar:3.1.4.GA:compile
[INFO] |  \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] +- org.richfaces.framework:richfaces-impl:jar:3.1.4.GA:compile
[INFO] |  \- commons-digester:commons-digester:jar:1.8:compile
[INFO] +- org.richfaces.ui:richfaces-ui:jar:3.1.4.GA:compile
[INFO] +- org.jboss.seam:jboss-seam:jar:2.0.2.SP1:compile
[INFO] |  \- org.jboss.el:jboss-el:jar:2.0.1.GA:compile
[INFO] +- org.jboss.seam:jboss-seam-debug:jar:2.0.2.SP1:compile
[INFO] +- org.jboss.seam:jboss-seam-ui:jar:2.0.2.SP1:compile
[INFO] +- javax.persistence:persistence-api:jar:1.0:provided
[INFO] \- org.testng:testng:jar:jdk15:5.8:test
[INFO]    \- junit:junit:jar:3.8.1:test

But in the .classpath we have :

<classpath>
  <classpathentry kind="src" path="src/main/java"/>
  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
  <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
  <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
  <classpathentry kind="output" path="target/classes"/>
  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
  <classpathentry kind="var" path="M2_REPO/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar"/>
  <classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar" sourcepath="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar"/>
  <classpathentry kind="var" path="M2_REPO/commons-digester/commons-digester/1.8/commons-digester-1.8.jar"/>
  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/jboss/el/jboss-el/2.0.1.GA/jboss-el-2.0.1.GA.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/jboss/seam/jboss-seam/2.0.2.SP1/jboss-seam-2.0.2.SP1.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/jboss/seam/jboss-seam-debug/2.0.2.SP1/jboss-seam-debug-2.0.2.SP1.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/jboss/seam/jboss-seam-ui/2.0.2.SP1/jboss-seam-ui-2.0.2.SP1.jar"/>
  <classpathentry kind="var" path="M2_REPO/com/sun/facelets/jsf-facelets/1.1.14/jsf-facelets-1.1.14.jar"/>
  <classpathentry kind="var" path="M2_REPO/javax/faces/jsf-impl/1.2_04-p02/jsf-impl-1.2_04-p02.jar"/>
  <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
  <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
  <classpathentry kind="var" path="M2_REPO/logkit/logkit/1.0.1/logkit-1.0.1.jar" sourcepath="M2_REPO/logkit/logkit/1.0.1/logkit-1.0.1-sources.jar"/>
  <classpathentry kind="var" path="M2_REPO/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar" sourcepath="M2_REPO/javax/persistence/persistence-api/1.0/persistence-api-1.0-sources.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/richfaces/framework/richfaces-api/3.1.4.GA/richfaces-api-3.1.4.GA.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/richfaces/framework/richfaces-impl/3.1.4.GA/richfaces-impl-3.1.4.GA.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/richfaces/ui/richfaces-ui/3.1.4.GA/richfaces-ui-3.1.4.GA.jar"/>
  <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/testng/testng/5.8/testng-5.8-jdk15.jar"/>
</classpath>

Arnaud Heritier added a comment - 01/Aug/08 09:54 AM

Dependencies are fine with m2eclipse


Bertrand Paquet added a comment - 14/Aug/08 09:43 AM

I have the same problem. This patch works perfectly for me.


Kristof Van Cleemput added a comment - 03/Dec/08 06:47 AM

This is a nasty bug and it's already fixed. So when is the release of the eclipse-plugin with bugfixes?


Arnaud Heritier added a comment - 03/Dec/08 07:01 AM

This bug isn't fixed and I cannot apply Bertrand's patch because it will require that you build your project before launching eclipse:eclipse. What I have in mind is to have a look at the code in the dependency:list mojo to try to reuse/recopy it.


Stefan Fleiter added a comment - 23/Feb/09 06:24 AM

I'm sorry to have to say that but if dependency resolution which in my opinion should the core of maven does not get implemented there once but gets copied between all the plugins depending on it then maven has failed.

Reuse is one othe the basics of software engineering.
Copying the code for dependency resolution is the source of the problem and not the answer.


Arnaud Heritier added a comment - 23/Feb/09 07:13 AM

Actually in maven 2.0.x, we can reuse the depdency mechanism from the core because there is no possibility to ask to maven to not resolve dependencies in the reactor. If we use the standard resolution mechanism you'll not be able to call an eclipse:eclipse goal if your project cannot be built. We are aware of this issue and are trying to solve it. But in the plugin to keep the compatibilility with 2.0.X we have to find a workaround.


Stefan Fleiter added a comment - 03/Mar/09 07:55 AM

You meant "can't" in the start of your comment, not "can", right?
Will the issue be fixed for maven 2.1.x and will the eclipse plugin
then use the algorithm form the core if the plugin is run by maven 2.1.x?


Arnaud Heritier added a comment - 03/Mar/09 04:53 PM

yes, "can't", sorry.
I have to admit that I'm not sure we'll have the necessary change in 2.1. Perhaps later. You can join us on the dev list to discuss about this..