Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency resolving with both scopes "compile" and "test" #9

Open
romain-wilbert opened this issue Dec 23, 2014 · 1 comment
Open

Comments

@romain-wilbert
Copy link

Hello,

I have a maven project which has the same dependency included twice : one with a "compile" scope, another with the "test" scope and a "test-jar" type.

In the "Dependencies" tab of the launcher, i can see both dependencies :

  • the one which has the "compile" scope in the pom.xml appears with a "test" scope and is therefore not added to the webapp classpath (Test scope checkbox not ticked)
  • the one which has the "test" scope in the pom.xml appears without scope, which is not normal as well

However if I import the dependency project in eclipse, things go OK in the launcher :

  • "classes" folder of the dependency has a "compile" scope
  • "test-classes" folder of the dependency has a "test" scope

When I close the project, things revert to previous situation.

@yulvil
Copy link

yulvil commented Feb 11, 2016

This is happening with version 3.9.0. From the Dependencies tab:

image

pom.xml

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.3.6</version>
    <scope>compile</scope>
</dependency>

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.3.6</version>
    <classifier>tests</classifier>
    <scope>test</scope>
</dependency>

The workaround is to in include the "Test Scope" dependencies in the Run Configurations -> Dependencies

I peeked at the code. Does the MavenScope need to be added to the MavenDependencyInfo.equals method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants