Maven 2.x Eclipse Plugin

Eclipse project set as dependency + test-jar dependency is included twice in .classpath

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.5
  • Fix Version/s: 2.6
  • Labels:
    None
  • Environment:
    maven 2.0.8, eclipse plugin version 2.5-20080218.113139-24
  • Number of attachments :
    0

Description

My maven project depends on A-util.jar for compile and A-util-tests.jar for tests :

<dependency>
<groupId>...
<artifactId>A-util</artifactId>
<version>...
</dependency>

<dependency>
<groupId>...
<artifactId>A-util</artifactId>
<version>...
<type>test-jar</type>
<scope>test</scope>
</dependency>

I have the "A-util" project in my eclipse workspace

Running mvn eclipse:eclipse creates an invalid .classpath where the eclipse A project is included twice :

<classpathentry kind="src" path="/A-util"/>
<classpathentry kind="src" path="/A-util"/>

.. and invalid .project with twice references :

<project>A-util</project>
<project>A-util</project>

Activity

Hide
nicolas de loof added a comment -

Issue is a little more complex.

When eclipse .classpath make reference to project A-util, it only includes default build directory (target/classes), so will never include the target/test-classes that matches the A-util-tests.jar.

I don't know if this is possible to specify build directory in target project in the .classpath XML format. The UI editor doesn't provides this option.

Show
nicolas de loof added a comment - Issue is a little more complex. When eclipse .classpath make reference to project A-util, it only includes default build directory (target/classes), so will never include the target/test-classes that matches the A-util-tests.jar. I don't know if this is possible to specify build directory in target project in the .classpath XML format. The UI editor doesn't provides this option.
Hide
nicolas de loof added a comment -

The issue comes from the anti-duplicates ID :

String depId = dep.getGroupId() + ":" + dep.getArtifactId() + ":" + dep.getClassifier() + ":" + dep.getVersion();

For dependencies referenced as eclipse project, the same ID must be generated for any classifier / version.

Also applied the anti-duplicate principle to .project writer.

Show
nicolas de loof added a comment - The issue comes from the anti-duplicates ID : String depId = dep.getGroupId() + ":" + dep.getArtifactId() + ":" + dep.getClassifier() + ":" + dep.getVersion(); For dependencies referenced as eclipse project, the same ID must be generated for any classifier / version. Also applied the anti-duplicate principle to .project writer.
Hide
nicolas de loof added a comment -

fixed in 2.5.2-20080520.120258-2

Show
nicolas de loof added a comment - fixed in 2.5.2-20080520.120258-2

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: