Maven 2.x Eclipse Plugin

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

Details

  • Number of attachments :
    2

Description

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

Issue Links

Activity

Hide
Arnaud Heritier added a comment -

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>
Show
Arnaud Heritier added a comment - 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>
Hide
Arnaud Heritier added a comment -

Dependencies are fine with m2eclipse

Show
Arnaud Heritier added a comment - Dependencies are fine with m2eclipse
Hide
Bertrand Paquet added a comment -

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

Show
Bertrand Paquet added a comment - I have the same problem. This patch works perfectly for me.
Hide
Kristof Van Cleemput added a comment -

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

Show
Kristof Van Cleemput added a comment - This is a nasty bug and it's already fixed. So when is the release of the eclipse-plugin with bugfixes?
Hide
Arnaud Heritier added a comment -

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.

Show
Arnaud Heritier added a comment - 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.
Hide
Stefan Fleiter added a comment -

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.

Show
Stefan Fleiter added a comment - 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.
Hide
Arnaud Heritier added a comment -

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.

Show
Arnaud Heritier added a comment - 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.
Hide
Stefan Fleiter added a comment -

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?

Show
Stefan Fleiter added a comment - 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?
Hide
Arnaud Heritier added a comment -

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

Show
Arnaud Heritier added a comment - 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..
Hide
Barrie Treloar added a comment -

2.9-SNAPSHOT fixes this.

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

Can you please give it a try?

Show
Barrie Treloar added a comment - 2.9-SNAPSHOT fixes this.
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-component-api/1.0-alpha-20/plexus-component-api-1.0-alpha-20.jar"/>
Can you please give it a try?

People

Vote (11)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: