Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7986

Spurious JUnit 4.12 jar on boot classpath

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.0.0-alpha-9
    • waiting-for-feedback
    • Core
    • None

    Description

      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.

      Attachments

        1. output-maven-4.0.0-alpha8-surefire-2.22.2.txt
          7 kB
          Jean Gauthier
        2. output-maven-4.0.0-alpha9-surefire-2.22.2.txt
          10 kB
          Jean Gauthier
        3. output-maven-4.0.0-alpha9-surefire-3.0.0-M4.txt
          12 kB
          Jean Gauthier
        4. reproducer.zip
          70 kB
          Jean Gauthier

        Activity

          People

            Unassigned Unassigned
            jgauthier-gradle Jean Gauthier
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: