Le 28/12/2016 à 21:49, Christian Schulte a écrit :
Am 12/28/16 um 21:34 schrieb Guillaume Boué:
I have the same results as Hervé, both on Windows and Ubuntu. This is
what I have with Maven 3.3.9:

- Windows 10 64bit, OpenJDK 1.8.0_102, Test failure: Timeout in
HugeFileDownloadTest (perhaps the timeout should be increased?)
- Ubuntu 16.04 32bit, OpenJDK 1.8.0_111, Maven 3.3.9: All OK
- Ubuntu 16.04 32bit, OpenJDK 1.7.0_95, Maven 3.3.9: All OK

With Maven 3.4.0-SNAPSHOT (65960ac18c8121648fe163612375a2ba5f4535c2), I
have compilation errors in the test class FileWagonTest (both on Windows
and Ubuntu)

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] 
/home/guillaume/workspace-maven/maven-wagon/wagon-providers/wagon-file/src/test/java/org/apache/maven/wagon/providers/file/FileWagonTest.java:[37,8]
 cannot access junit.framework.TestCase
    class file for junit.framework.TestCase not found
[ERROR] 
/home/guillaume/workspace-maven/maven-wagon/wagon-providers/wagon-file/src/test/java/org/apache/maven/wagon/providers/file/FileWagonTest.java:[48,52]
 cannot find symbol
    symbol:   method getName()
    location: class org.apache.maven.wagon.providers.file.FileWagonTest

The JUnit dependency isn't getting pulled. This is the scenario at hand:

- wagon-file has as parent wagon-providers which has a dependency on
wagon-provider-test with scope test.
- wagon-provider-test has a compile scoped dependency on junit
(<scope>compile</scope> is explicitly written).
- wagon-provider-test has as parent wagon, which has a test scoped
dependency management on junit.

What would be the problem?
Overriding the dependency management is only possible in the direct
dependencies (in the POM). When resolving a dependency, those overrides
are beeing ignored and the management gets applied. That's always been
that way. If your test classes need junit, you should declare junit in
the POM and not rely on it to be there transitively. The dependency
plugin's analyze goal would warn about this for the main artifact
(src/main) but not for the test artifact (src/test).


How come the tests compile fine with Maven 2.2.1, 3.0.5 and 3.3.9 then?

This is the tree with Maven 3.3.9:

[DEBUG] org.apache.maven.wagon:wagon-file:jar:2.12-SNAPSHOT
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.0.24:compile
[DEBUG]    org.slf4j:slf4j-simple:jar:1.7.19:test
[DEBUG]       org.slf4j:slf4j-api:jar:1.7.19:test
[DEBUG]    org.apache.maven.wagon:wagon-provider-api:jar:2.12-SNAPSHOT:compile
[DEBUG]    org.apache.maven.wagon:wagon-provider-test:jar:2.12-SNAPSHOT:test
[DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.5.5:test
[DEBUG]          org.codehaus.plexus:plexus-classworlds:jar:2.2.2:test
[DEBUG]          org.apache.xbean:xbean-reflect:jar:3.4:test
[DEBUG]             log4j:log4j:jar:1.2.12:test
[DEBUG]             commons-logging:commons-logging-api:jar:1.1:test
[DEBUG]          com.google.collections:google-collections:jar:1.0:test
[DEBUG]       org.easymock:easymock:jar:3.2:test
[DEBUG]          cglib:cglib-nodep:jar:2.2.2:test
[DEBUG]          org.objenesis:objenesis:jar:1.3:test
[DEBUG]       org.eclipse.jetty.aggregate:jetty-all:jar:8.1.22.v20160922:test
[DEBUG]          
org.eclipse.jetty.orbit:javax.servlet:jar:3.0.0.v201112011016:test
[DEBUG]       javax.servlet:javax.servlet-api:jar:3.0.1:test
[DEBUG]       junit:junit:jar:4.11:test (scope managed from compile by 
org.apache.maven.wagon:wagon:2.12-SNAPSHOT)
[DEBUG]          org.hamcrest:hamcrest-core:jar:1.3:test




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to