Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
None
-
None
Description
I have an artifact A (elsag-test below), that is used by other projects only for the tests. A has a dependency to commons-logging. Artifact B has a compile-time dependency to an artifact, that also has a dependency on commons-logging. Nevertheless, the resulting scope for commons-logging is wrongly calculated as test and the compilation fails.
============= %< ================
[DEBUG] Retrieving parent-POM from the repository for project: com.elsagsolutions.commons:super-project:pom:1.1-SNAPSHOT
[DEBUG] meta: using locally installed snapshot
[DEBUG] com.elsagsolutions.commons:elsag-test:jar:1.2-SNAPSHOT (selected for test)
[DEBUG] cglib:cglib-nodep:jar:2.1_3 (selected for test)
[DEBUG] commons-logging:commons-logging:jar:1.0.4 (selected for test)
[DEBUG] jmock:jmock-cglib:jar:1.0.1 (selected for test)
[DEBUG] jmock:jmock:jar:1.0.1 (selected for test)
[DEBUG] junit:junit:jar:3.8.1 (selected for test)
[DEBUG] commons-httpclient:commons-httpclient:jar:2.0.2 (selected for compile)
[DEBUG] commons-logging:commons-logging:jar:1.0.4 (setting scope to: compile)
[DEBUG] commons-logging:commons-logging:jar:1.0.3 (removed - nearer found: 1.0.4)
[DEBUG] commons-logging:commons-logging:jar:1.0.3 (selected for compile)
[DEBUG] commons-io:commons-io:jar:1.0 (selected for compile)
[DEBUG] junit:junit:jar:3.8.1 (selected for compile)
============= %< ================
[INFO] ----------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ----------------------------------------------------------------------------
[INFO] Compilation failure
C:\Work\Projects\commons\lang\src\java\com\elsagsolutions\lang\net\AbstractSocketStreamServer.java:[14,34] package org.apache.commons.logging does not exist
============= %< ================
If I add commons-logging as direct dependency of B it works:
============= %< ================
[DEBUG] Retrieving parent-POM from the repository for project: com.elsagsolutions.commons:super-project:pom:1.1-SNAPSHOT
[DEBUG] meta: using locally installed snapshot
[DEBUG] com.elsagsolutions.commons:elsag-test:jar:1.2-SNAPSHOT (selected for test)
[DEBUG] cglib:cglib-nodep:jar:2.1_3 (selected for test)
[DEBUG] commons-logging:commons-logging:jar:1.0.4 (selected for test)
[DEBUG] jmock:jmock-cglib:jar:1.0.1 (selected for test)
[DEBUG] jmock:jmock:jar:1.0.1 (selected for test)
[DEBUG] junit:junit:jar:3.8.1 (selected for test)
[DEBUG] commons-logging:commons-logging:jar:1.0.4 (selected for compile)
[DEBUG] commons-httpclient:commons-httpclient:jar:2.0.2 (selected for compile)
[DEBUG] commons-logging:commons-logging:jar:1.0.3 (removed - nearer found: 1.0.4)
[DEBUG] commons-logging:commons-logging:jar:1.0.3 (selected for compile)
============= %< ================
Unfortunately this introduces a dependency for commons-logging, therefore I wanted to set the dep at least optional, but then commons-logging is again not available at compile time. Might be related to MNG-1378.
Attachments
Issue Links
- duplicates
-
MNG-1895 Dependencies in two paths are not added to resolution when scope needs to be updated in the nearest due to any of nearest parents
- Closed
- is depended upon by
-
MNG-1823 dependencies with classifier mask transitive dependencies of same dependency without classifier
- Closed
- is related to
-
MNG-1378 Make dependencies of test-jars transitive
- Open
-
MNG-1971 Transitive dependencies not following attached tests.
- Closed
- relates to
-
MNG-1568 test-jar dependency clobbers transitive dependency
- Closed