[ https://issues.apache.org/jira/browse/MNG-7986?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17801370#comment-17801370 ]
Karl Heinz Marbaise commented on MNG-7986: ------------------------------------------ That reproducer example contains a lot of far outdated plugins (apart from usign Java 7 as target). I have updated all the plugins in the example in relationship to https://maven.apache.org/plugins/ (most recent versions). I tested with Maven 4.0.0-alpha-10, 3.9.6, 3.8.8, 3.6.3, 3.5.4, 3.3.9 and as [~michael-o] suggest using Surefire 3.2.3 and it shows the expected output: {code} [INFO] --- maven-surefire-plugin:3.2.3:test (default-test) @ reproducer --- [INFO] Using auto detected provider org.apache.maven.surefire.junit4.JUnit4Provider [INFO] [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- Creation of Run Listener... [INFO] Running org.example.SimpleTest RunListener - testSuiteStarted RunListener - testStarted [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.021 s -- in org.example.SimpleTest [INFO] {code} That means in consequence you should upgrade all the plugins you are using including the Maven version... We have a new alpha-10 version of Maven 4 available... https://maven.apache.org/docs/history.html it's great to see people are testing with the new Maven 4.0.0 alpha versions, but I recommend to test with most recent version of the plugins. Also I recommend to take into account that JUnit 4.X might be out-of-date as well and should be replaced it with JUnit Jupiter (aka JUnit 5) https://junit.org/junit5/ > Spurious JUnit 4.12 jar on boot classpath > ----------------------------------------- > > Key: MNG-7986 > URL: https://issues.apache.org/jira/browse/MNG-7986 > Project: Maven > Issue Type: Bug > Components: Core > Affects Versions: 4.0.0-alpha-9 > Reporter: Jean Gauthier > Priority: Major > Attachments: output-maven-4.0.0-alpha8-surefire-2.22.2.txt, > output-maven-4.0.0-alpha9-surefire-2.22.2.txt, > output-maven-4.0.0-alpha9-surefire-3.0.0-M4.txt, reproducer.zip > > > We noticed a regression in Maven 4.0.0-alpha9 for Surefire versions > 2.21.0-3.0.0-M3: when specifying a dependency to JUnit 4.13, JUnit 4.12 gets > added before it on the boot classpath. > This causes issues e.g. when defining a custom JUnit 4 RunListener in a > project: because JUnit 4.12 is listed first, the new {{testSuiteStarted}} > callback that was added in 4.13 does not get invoked anymore. > This can be reproduced by running {{./mvnw clean test > -Dorg.slf4j.simpleLogger.log.org.apache.maven.plugin.surefire.SurefirePlugin=debug}} > on the attached project (and setting the Maven/Surefire versions > accordingly). > I have also added the output logs for the following version combinations as > attachment to the ticket: > * Maven 4.0.0-alpha8 + Surefire 2.22.2 => works correctly (contains > {{RunListener - testSuiteStarted}}) > * Maven 4.0.0-alpha9 + Surefire 2.22.2 => broken (does not contain > {{RunListener - testSuiteStarted}}) > * Maven 4.0.0-alpha9 + Surefire 3.0.0-M4 => works correctly (contains > {{RunListener - testSuiteStarted}}) > Please let me know in case additional information is needed. -- This message was sent by Atlassian Jira (v8.20.10#820010)