junit-team / junit5

✅ The 5th major version of the programmer-friendly testing framework for Java and the JVM
https://junit.org
Other
6.35k stars 1.48k forks source link

Dependency leak with maven-failsafe-plugin #1318

Closed hwellmann closed 6 years ago

hwellmann commented 6 years ago

Bug report

Scenario

When running tests with junit-platform-surefire-provider under maven-failsafe-plugin, plugin dependencies pollute the test classpath.

This does not happen when running the same test under maven-surefire-plugin.

In particular, there is a dependency on org.slf4j:slf4j-jdk14:jar:1.5.6 and org.slf4j:jcl-over-slf4j:jar:1.5.6 which may cause NoSuchMethodError when the project is compiled with newer versions of these dependencies.

Reproduction steps

git clone https://github.com/hwellmann/junit5-failsafe.git
cd junit5-failsafe
mvn verify

[INFO] --- maven-failsafe-plugin:2.19.1:integration-test (it) @ junit5-failsafe ---

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.ops4j.junit5.FailsafeTest
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hwellmann/.m2/repository/ch/qos/logback/logback-classic/1.0.7/logback-classic-1.0.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hwellmann/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
19:09:54.084 [main] INFO  slf4j - logging from slf4j
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.128 sec <<< FAILURE! - in org.ops4j.junit5.FailsafeTest
shouldLog  Time elapsed: 0.127 sec  <<< ERROR!
java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
        at org.ops4j.junit5.FailsafeTest.shouldLog(FailsafeTest.java:12)

Versions

JUnit 5.1.0 JUnit Platform 1.1.0 Maven Surefire and Failsafe Plugin 2.19.1

marcphilipp commented 6 years ago

Hmm, very strange.

This is the MANIFEST.MF that the maven-failsafe-plugin creates when I run it on my machine:

Manifest-Version: 1.0
Class-Path: file:/Users/marcph/.m2/repository/org/apache/maven/surefir
 e/surefire-booter/2.19.1/surefire-booter-2.19.1.jar file:/Users/marcp
 h/.m2/repository/org/apache/maven/surefire/surefire-api/2.19.1/surefi
 re-api-2.19.1.jar file:/Users/marcph/Desktop/junit5-failsafe/target/t
 est-classes/ file:/Users/marcph/Desktop/junit5-failsafe/target/junit5
 -failsafe-0.1.0-SNAPSHOT.jar file:/Users/marcph/.m2/repository/ch/qos
 /logback/logback-classic/1.0.7/logback-classic-1.0.7.jar file:/Users/
 marcph/.m2/repository/ch/qos/logback/logback-core/1.0.7/logback-core-
 1.0.7.jar file:/Users/marcph/.m2/repository/commons-logging/commons-l
 ogging/1.2/commons-logging-1.2.jar file:/Users/marcph/.m2/repository/
 org/junit/jupiter/junit-jupiter-api/5.1.0/junit-jupiter-api-5.1.0.jar
  file:/Users/marcph/.m2/repository/org/apiguardian/apiguardian-api/1.
 0.0/apiguardian-api-1.0.0.jar file:/Users/marcph/.m2/repository/org/o
 pentest4j/opentest4j/1.0.0/opentest4j-1.0.0.jar file:/Users/marcph/.m
 2/repository/org/junit/platform/junit-platform-commons/1.1.0/junit-pl
 atform-commons-1.1.0.jar file:/Users/marcph/.m2/repository/org/junit/
 jupiter/junit-jupiter-engine/5.1.0/junit-jupiter-engine-5.1.0.jar fil
 e:/Users/marcph/.m2/repository/org/junit/platform/junit-platform-engi
 ne/1.1.0/junit-platform-engine-1.1.0.jar file:/Users/marcph/.m2/repos
 itory/org/junit/platform/junit-platform-launcher/1.1.0/junit-platform
 -launcher-1.1.0.jar file:/Users/marcph/.m2/repository/org/slf4j/slf4j
 -api/1.7.7/slf4j-api-1.7.7.jar file:/Users/marcph/.m2/repository/org/
 apache/maven/plugins/maven-failsafe-plugin/2.19.1/maven-failsafe-plug
 in-2.19.1.jar file:/Users/marcph/.m2/repository/org/junit/platform/ju
 nit-platform-surefire-provider/1.1.0/junit-platform-surefire-provider
 -1.1.0.jar file:/Users/marcph/.m2/repository/org/apache/maven/surefir
 e/common-java5/2.19.1/common-java5-2.19.1.jar file:/Users/marcph/.m2/
 repository/org/apache/maven/maven-plugin-api/2.2.1/maven-plugin-api-2
 .2.1.jar file:/Users/marcph/.m2/repository/org/apache/maven/surefire/
 maven-surefire-common/2.19.1/maven-surefire-common-2.19.1.jar file:/U
 sers/marcph/.m2/repository/org/apache/maven/maven-artifact/2.2.1/mave
 n-artifact-2.2.1.jar file:/Users/marcph/.m2/repository/org/codehaus/p
 lexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar file:/Users/marcph/
 .m2/repository/org/apache/maven/maven-plugin-descriptor/2.2.1/maven-p
 lugin-descriptor-2.2.1.jar file:/Users/marcph/.m2/repository/org/code
 haus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-cont
 ainer-default-1.0-alpha-9-stable-1.jar file:/Users/marcph/.m2/reposit
 ory/junit/junit/4.12/junit-4.12.jar file:/Users/marcph/.m2/repository
 /org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar file:/Users/mar
 cph/.m2/repository/org/apache/maven/maven-project/2.2.1/maven-project
 -2.2.1.jar file:/Users/marcph/.m2/repository/org/apache/maven/maven-s
 ettings/2.2.1/maven-settings-2.2.1.jar file:/Users/marcph/.m2/reposit
 ory/org/apache/maven/maven-profile/2.2.1/maven-profile-2.2.1.jar file
 :/Users/marcph/.m2/repository/org/apache/maven/maven-artifact-manager
 /2.2.1/maven-artifact-manager-2.2.1.jar file:/Users/marcph/.m2/reposi
 tory/backport-util-concurrent/backport-util-concurrent/3.1/backport-u
 til-concurrent-3.1.jar file:/Users/marcph/.m2/repository/org/apache/m
 aven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.jar file
 :/Users/marcph/.m2/repository/org/codehaus/plexus/plexus-interpolatio
 n/1.11/plexus-interpolation-1.11.jar file:/Users/marcph/.m2/repositor
 y/org/apache/maven/maven-model/2.2.1/maven-model-2.2.1.jar file:/User
 s/marcph/.m2/repository/org/apache/maven/maven-core/2.2.1/maven-core-
 2.2.1.jar file:/Users/marcph/.m2/repository/org/apache/maven/maven-pl
 ugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2
 .1.jar file:/Users/marcph/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/
 slf4j-jdk14-1.5.6.jar file:/Users/marcph/.m2/repository/org/slf4j/slf
 4j-api/1.5.6/slf4j-api-1.5.6.jar file:/Users/marcph/.m2/repository/or
 g/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar file:/Users/mar
 cph/.m2/repository/org/apache/maven/reporting/maven-reporting-api/3.0
 /maven-reporting-api-3.0.jar file:/Users/marcph/.m2/repository/org/ap
 ache/maven/maven-repository-metadata/2.2.1/maven-repository-metadata-
 2.2.1.jar file:/Users/marcph/.m2/repository/org/apache/maven/maven-er
 ror-diagnostics/2.2.1/maven-error-diagnostics-2.2.1.jar file:/Users/m
 arcph/.m2/repository/org/apache/maven/maven-monitor/2.2.1/maven-monit
 or-2.2.1.jar file:/Users/marcph/.m2/repository/classworlds/classworld
 s/1.1/classworlds-1.1.jar file:/Users/marcph/.m2/repository/org/sonat
 ype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar fi
 le:/Users/marcph/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4
 /plexus-cipher-1.4.jar file:/Users/marcph/.m2/repository/org/apache/m
 aven/maven-toolchain/2.2.1/maven-toolchain-2.2.1.jar file:/Users/marc
 ph/.m2/repository/org/apache/commons/commons-lang3/3.1/commons-lang3-
 3.1.jar file:/Users/marcph/.m2/repository/org/apache/maven/plugin-too
 ls/maven-plugin-annotations/3.3/maven-plugin-annotations-3.3.jar
Main-Class: org.apache.maven.surefire.booter.ForkedBooter

In comparison, the one created by the maven-surefire-plugin is much shorter:

Manifest-Version: 1.0
Class-Path: file:/Users/marcph/.m2/repository/org/apache/maven/surefir
 e/surefire-booter/2.19.1/surefire-booter-2.19.1.jar file:/Users/marcp
 h/.m2/repository/org/apache/maven/surefire/surefire-api/2.19.1/surefi
 re-api-2.19.1.jar file:/Users/marcph/Desktop/junit5-failsafe/target/t
 est-classes/ file:/Users/marcph/Desktop/junit5-failsafe/target/classe
 s file:/Users/marcph/.m2/repository/ch/qos/logback/logback-classic/1.
 0.7/logback-classic-1.0.7.jar file:/Users/marcph/.m2/repository/ch/qo
 s/logback/logback-core/1.0.7/logback-core-1.0.7.jar file:/Users/marcp
 h/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-
 1.2.jar file:/Users/marcph/.m2/repository/org/junit/jupiter/junit-jup
 iter-api/5.1.0/junit-jupiter-api-5.1.0.jar file:/Users/marcph/.m2/rep
 ository/org/apiguardian/apiguardian-api/1.0.0/apiguardian-api-1.0.0.j
 ar file:/Users/marcph/.m2/repository/org/opentest4j/opentest4j/1.0.0/
 opentest4j-1.0.0.jar file:/Users/marcph/.m2/repository/org/junit/plat
 form/junit-platform-commons/1.1.0/junit-platform-commons-1.1.0.jar fi
 le:/Users/marcph/.m2/repository/org/junit/jupiter/junit-jupiter-engin
 e/5.1.0/junit-jupiter-engine-5.1.0.jar file:/Users/marcph/.m2/reposit
 ory/org/junit/platform/junit-platform-engine/1.1.0/junit-platform-eng
 ine-1.1.0.jar file:/Users/marcph/.m2/repository/org/junit/platform/ju
 nit-platform-launcher/1.1.0/junit-platform-launcher-1.1.0.jar file:/U
 sers/marcph/.m2/repository/org/slf4j/slf4j-api/1.7.7/slf4j-api-1.7.7.
 jar file:/Users/marcph/.m2/repository/org/junit/platform/junit-platfo
 rm-surefire-provider/1.1.0/junit-platform-surefire-provider-1.1.0.jar
  file:/Users/marcph/.m2/repository/org/apache/maven/surefire/common-j
 ava5/2.19.1/common-java5-2.19.1.jar file:/Users/marcph/.m2/repository
 /junit/junit/4.12/junit-4.12.jar file:/Users/marcph/.m2/repository/or
 g/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar file:/Users/marcph
 /.m2/repository/org/apache/maven/reporting/maven-reporting-api/3.0/ma
 ven-reporting-api-3.0.jar
Main-Class: org.apache.maven.surefire.booter.ForkedBooter

To me, it looks like this is an issue for the Maven Surefire team.

@Tibor17 Can you please shed some light on what's going on here?

Tibor17 commented 6 years ago

Here the difference between both plugins is tha packaging. The Failsafe accepts *.jar of your POM and Surefire takes target/classes. Can you make a diff?

On Mon, Mar 5, 2018 at 1:55 PM, Marc Philipp notifications@github.com wrote:

Hmm, very strange.

This is the MANIFEST.MF that the maven-failsafe-plugin creates when I run it on my machine:

Manifest-Version: 1.0 Class-Path: file:/Users/marcph/.m2/repository/org/apache/maven/surefir e/surefire-booter/2.19.1/surefire-booter-2.19.1.jar file:/Users/marcp h/.m2/repository/org/apache/maven/surefire/surefire-api/2.19.1/surefi re-api-2.19.1.jar file:/Users/marcph/Desktop/junit5-failsafe/target/t est-classes/ file:/Users/marcph/Desktop/junit5-failsafe/target/junit5 -failsafe-0.1.0-SNAPSHOT.jar file:/Users/marcph/.m2/repository/ch/qos /logback/logback-classic/1.0.7/logback-classic-1.0.7.jar file:/Users/ marcph/.m2/repository/ch/qos/logback/logback-core/1.0.7/logback-core- 1.0.7.jar file:/Users/marcph/.m2/repository/commons-logging/commons-l ogging/1.2/commons-logging-1.2.jar file:/Users/marcph/.m2/repository/ org/junit/jupiter/junit-jupiter-api/5.1.0/junit-jupiter-api-5.1.0.jar file:/Users/marcph/.m2/repository/org/apiguardian/apiguardian-api/1. 0.0/apiguardian-api-1.0.0.jar file:/Users/marcph/.m2/repository/org/o pentest4j/opentest4j/1.0.0/opentest4j-1.0.0.jar file:/Users/marcph/.m 2/repository/org/junit/platform/junit-platform-commons/1.1.0/junit-pl atform-commons-1.1.0.jar file:/Users/marcph/.m2/repository/org/junit/ jupiter/junit-jupiter-engine/5.1.0/junit-jupiter-engine-5.1.0.jar fil e:/Users/marcph/.m2/repository/org/junit/platform/junit-platform-engi ne/1.1.0/junit-platform-engine-1.1.0.jar file:/Users/marcph/.m2/repos itory/org/junit/platform/junit-platform-launcher/1.1.0/junit-platform -launcher-1.1.0.jar file:/Users/marcph/.m2/repository/org/slf4j/slf4j -api/1.7.7/slf4j-api-1.7.7.jar file:/Users/marcph/.m2/repository/org/ apache/maven/plugins/maven-failsafe-plugin/2.19.1/maven-failsafe-plug in-2.19.1.jar file:/Users/marcph/.m2/repository/org/junit/platform/ju nit-platform-surefire-provider/1.1.0/junit-platform-surefire-provider -1.1.0.jar file:/Users/marcph/.m2/repository/org/apache/maven/surefir e/common-java5/2.19.1/common-java5-2.19.1.jar file:/Users/marcph/.m2/ repository/org/apache/maven/maven-plugin-api/2.2.1/maven-plugin-api-2 .2.1.jar file:/Users/marcph/.m2/repository/org/apache/maven/surefire/ maven-surefire-common/2.19.1/maven-surefire-common-2.19.1.jar file:/U sers/marcph/.m2/repository/org/apache/maven/maven-artifact/2.2.1/mave n-artifact-2.2.1.jar file:/Users/marcph/.m2/repository/org/codehaus/p lexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar file:/Users/marcph/ .m2/repository/org/apache/maven/maven-plugin-descriptor/2.2.1/maven-p lugin-descriptor-2.2.1.jar file:/Users/marcph/.m2/repository/org/code haus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-cont ainer-default-1.0-alpha-9-stable-1.jar file:/Users/marcph/.m2/reposit ory/junit/junit/4.12/junit-4.12.jar file:/Users/marcph/.m2/repository /org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar file:/Users/mar cph/.m2/repository/org/apache/maven/maven-project/2.2.1/maven-project -2.2.1.jar file:/Users/marcph/.m2/repository/org/apache/maven/maven-s ettings/2.2.1/maven-settings-2.2.1.jar file:/Users/marcph/.m2/reposit ory/org/apache/maven/maven-profile/2.2.1/maven-profile-2.2.1.jar file :/Users/marcph/.m2/repository/org/apache/maven/maven-artifact-manager /2.2.1/maven-artifact-manager-2.2.1.jar file:/Users/marcph/.m2/reposi tory/backport-util-concurrent/backport-util-concurrent/3.1/backport-u til-concurrent-3.1.jar file:/Users/marcph/.m2/repository/org/apache/m aven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.jar file :/Users/marcph/.m2/repository/org/codehaus/plexus/plexus-interpolatio n/1.11/plexus-interpolation-1.11.jar file:/Users/marcph/.m2/repositor y/org/apache/maven/maven-model/2.2.1/maven-model-2.2.1.jar file:/User s/marcph/.m2/repository/org/apache/maven/maven-core/2.2.1/maven-core- 2.2.1.jar file:/Users/marcph/.m2/repository/org/apache/maven/maven-pl ugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2 .1.jar file:/Users/marcph/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/ slf4j-jdk14-1.5.6.jar file:/Users/marcph/.m2/repository/org/slf4j/slf 4j-api/1.5.6/slf4j-api-1.5.6.jar file:/Users/marcph/.m2/repository/or g/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar file:/Users/mar cph/.m2/repository/org/apache/maven/reporting/maven-reporting-api/3.0 /maven-reporting-api-3.0.jar file:/Users/marcph/.m2/repository/org/ap ache/maven/maven-repository-metadata/2.2.1/maven-repository-metadata- 2.2.1.jar file:/Users/marcph/.m2/repository/org/apache/maven/maven-er ror-diagnostics/2.2.1/maven-error-diagnostics-2.2.1.jar file:/Users/m arcph/.m2/repository/org/apache/maven/maven-monitor/2.2.1/maven-monit or-2.2.1.jar file:/Users/marcph/.m2/repository/classworlds/classworld s/1.1/classworlds-1.1.jar file:/Users/marcph/.m2/repository/org/sonat ype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar fi le:/Users/marcph/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4 /plexus-cipher-1.4.jar file:/Users/marcph/.m2/repository/org/apache/m aven/maven-toolchain/2.2.1/maven-toolchain-2.2.1.jar file:/Users/marc ph/.m2/repository/org/apache/commons/commons-lang3/3.1/commons-lang3- 3.1.jar file:/Users/marcph/.m2/repository/org/apache/maven/plugin-too ls/maven-plugin-annotations/3.3/maven-plugin-annotations-3.3.jar Main-Class: org.apache.maven.surefire.booter.ForkedBooter

In comparison, the one created by the maven-surefire-plugin is much shorter:

Manifest-Version: 1.0 Class-Path: file:/Users/marcph/.m2/repository/org/apache/maven/surefir e/surefire-booter/2.19.1/surefire-booter-2.19.1.jar file:/Users/marcp h/.m2/repository/org/apache/maven/surefire/surefire-api/2.19.1/surefi re-api-2.19.1.jar file:/Users/marcph/Desktop/junit5-failsafe/target/t est-classes/ file:/Users/marcph/Desktop/junit5-failsafe/target/classe s file:/Users/marcph/.m2/repository/ch/qos/logback/logback-classic/1. 0.7/logback-classic-1.0.7.jar file:/Users/marcph/.m2/repository/ch/qo s/logback/logback-core/1.0.7/logback-core-1.0.7.jar file:/Users/marcp h/.m2/repository/commons-logging/commons-logging/1.2/commons-logging- 1.2.jar file:/Users/marcph/.m2/repository/org/junit/jupiter/junit-jup iter-api/5.1.0/junit-jupiter-api-5.1.0.jar file:/Users/marcph/.m2/rep ository/org/apiguardian/apiguardian-api/1.0.0/apiguardian-api-1.0.0.j ar file:/Users/marcph/.m2/repository/org/opentest4j/opentest4j/1.0.0/ opentest4j-1.0.0.jar file:/Users/marcph/.m2/repository/org/junit/plat form/junit-platform-commons/1.1.0/junit-platform-commons-1.1.0.jar fi le:/Users/marcph/.m2/repository/org/junit/jupiter/junit-jupiter-engin e/5.1.0/junit-jupiter-engine-5.1.0.jar file:/Users/marcph/.m2/reposit ory/org/junit/platform/junit-platform-engine/1.1.0/junit-platform-eng ine-1.1.0.jar file:/Users/marcph/.m2/repository/org/junit/platform/ju nit-platform-launcher/1.1.0/junit-platform-launcher-1.1.0.jar file:/U sers/marcph/.m2/repository/org/slf4j/slf4j-api/1.7.7/slf4j-api-1.7.7. jar file:/Users/marcph/.m2/repository/org/junit/platform/junit-platfo rm-surefire-provider/1.1.0/junit-platform-surefire-provider-1.1.0.jar file:/Users/marcph/.m2/repository/org/apache/maven/surefire/common-j ava5/2.19.1/common-java5-2.19.1.jar file:/Users/marcph/.m2/repository /junit/junit/4.12/junit-4.12.jar file:/Users/marcph/.m2/repository/or g/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar file:/Users/marcph /.m2/repository/org/apache/maven/reporting/maven-reporting-api/3.0/ma ven-reporting-api-3.0.jar Main-Class: org.apache.maven.surefire.booter.ForkedBooter

To me, it looks like this is an issue for the Maven Surefire team.

@Tibor17 https://github.com/tibor17 Can you please shed some light on what's going on here?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/junit-team/junit5/issues/1318#issuecomment-370410361, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_yR2ZqmRKAip7A3nW9kqjohe3l4psFks5tbTXZgaJpZM4SbBwb .

-- Cheers Tibor

marcphilipp commented 6 years ago

Can you make a diff?

Of the Class-Path in the manifest?

Tibor17 commented 6 years ago

Yes, what I see different is *:2.2.1. I can check it out with the latest 2.21.0 by my own but later.

On Mon, Mar 5, 2018 at 4:30 PM, Marc Philipp notifications@github.com wrote:

Can you make a diff?

Of the Class-Path in the manifest?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/junit-team/junit5/issues/1318#issuecomment-370456373, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_yR3bRqzMGS6rX2DFkhXvG7HDNaNlEks5tbVongaJpZM4SbBwb .

-- Cheers Tibor

marcphilipp commented 6 years ago

Here's the diff of surefire.txt and failsafe.txt:

4c4
< file:/Users/marcph/Desktop/junit5-failsafe/target/classes
---
> file:/Users/marcph/Desktop/junit5-failsafe/target/junit5-failsafe-0.1.0-SNAPSHOT.jar
15a16
> file:/Users/marcph/.m2/repository/org/apache/maven/plugins/maven-failsafe-plugin/2.19.1/maven-failsafe-plugin-2.19.1.jar
17a19,24
> file:/Users/marcph/.m2/repository/org/apache/maven/maven-plugin-api/2.2.1/maven-plugin-api-2.2.1.jar
> file:/Users/marcph/.m2/repository/org/apache/maven/surefire/maven-surefire-common/2.19.1/maven-surefire-common-2.19.1.jar
> file:/Users/marcph/.m2/repository/org/apache/maven/maven-artifact/2.2.1/maven-artifact-2.2.1.jar
> file:/Users/marcph/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar
> file:/Users/marcph/.m2/repository/org/apache/maven/maven-plugin-descriptor/2.2.1/maven-plugin-descriptor-2.2.1.jar
> file:/Users/marcph/.m2/repository/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar
19a27,39
> file:/Users/marcph/.m2/repository/org/apache/maven/maven-project/2.2.1/maven-project-2.2.1.jar
> file:/Users/marcph/.m2/repository/org/apache/maven/maven-settings/2.2.1/maven-settings-2.2.1.jar
> file:/Users/marcph/.m2/repository/org/apache/maven/maven-profile/2.2.1/maven-profile-2.2.1.jar
> file:/Users/marcph/.m2/repository/org/apache/maven/maven-artifact-manager/2.2.1/maven-artifact-manager-2.2.1.jar
> file:/Users/marcph/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
> file:/Users/marcph/.m2/repository/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.jar
> file:/Users/marcph/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar
> file:/Users/marcph/.m2/repository/org/apache/maven/maven-model/2.2.1/maven-model-2.2.1.jar
> file:/Users/marcph/.m2/repository/org/apache/maven/maven-core/2.2.1/maven-core-2.2.1.jar
> file:/Users/marcph/.m2/repository/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.jar
> file:/Users/marcph/.m2/repository/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.jar
> file:/Users/marcph/.m2/repository/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6.jar
> file:/Users/marcph/.m2/repository/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.jar
20a41,49
> file:/Users/marcph/.m2/repository/org/apache/maven/maven-repository-metadata/2.2.1/maven-repository-metadata-2.2.1.jar
> file:/Users/marcph/.m2/repository/org/apache/maven/maven-error-diagnostics/2.2.1/maven-error-diagnostics-2.2.1.jar
> file:/Users/marcph/.m2/repository/org/apache/maven/maven-monitor/2.2.1/maven-monitor-2.2.1.jar
> file:/Users/marcph/.m2/repository/classworlds/classworlds/1.1/classworlds-1.1.jar
> file:/Users/marcph/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
> file:/Users/marcph/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
> file:/Users/marcph/.m2/repository/org/apache/maven/maven-toolchain/2.2.1/maven-toolchain-2.2.1.jar
> file:/Users/marcph/.m2/repository/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar
> file:/Users/marcph/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.3/maven-plugin-annotations-3.3.jar
marcphilipp commented 6 years ago

These extra JARs seem to get added by the maven-failsafe-plugin for some reason. They are certainly not added by our Surefire provider.

@hwellmann Can you please open an issue in Surefire‘s Jira project?

Tibor17 commented 6 years ago

You have tested it with Version 2.19.x. Repeat it with 2.21.0; otherwise I will ask you to do it in our Jira anyway. And provide a project to reproduce this issue. Thx.

On Wed, Mar 7, 2018 at 9:08 AM, Marc Philipp notifications@github.com wrote:

These extra JARs seem to get added by the maven-failsafe-plugin for some reason. They are certainly not added by our Surefire provider.

@hwellmann https://github.com/hwellmann Can you please open an issue in Surefire‘s Jira project?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/junit-team/junit5/issues/1318#issuecomment-371057057, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_yR8F_gw1niIGxwfBJ_bC6bcofSFJdks5tb5WPgaJpZM4SbBwb .

-- Cheers Tibor

marcphilipp commented 6 years ago

Using Surefire/Failsafe 2.21.0 and the latest snapshots resolves the issue: https://github.com/marcphilipp/junit5-failsafe/commit/ece8ed9579ca1fc408591e844dcbeac9c4655771

[INFO] --- maven-failsafe-plugin:2.21.0:integration-test (it) @ junit5-failsafe ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.ops4j.junit5.FailsafeTest
16:37:58.277 [main] INFO  slf4j - logging from slf4j
Mar 07, 2018 4:37:58 PM jcl shouldLog
INFO: logging from commons-logging
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.123 s - in org.ops4j.junit5.FailsafeTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.809 s
[INFO] Finished at: 2018-03-07T16:37:58+01:00
[INFO] Final Memory: 20M/67M
[INFO] ------------------------------------------------------------------------
hwellmann commented 6 years ago

Tested successfully with 5.2.0-SNAPSHOT in the context where the problem originally ocurred (i.e. not my small demo project).

marcphilipp commented 6 years ago

@hwellmann Thanks for reporting back -- I'm glad it works now! 👍