Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-2085

Surefire fails build on Modules that don't use surefire at all if -DexcludedGroups is given

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0-M6
    • None
    • None
    • None

    Description

      Assume a simple multi-module project with an API and an implementation module with JUnit as the testing framework. The API module just has interfaces and no unit tests at all, thus, no dependency to junit. It does not declare any configuration of the surefire-plugin in its POM. The implementation module uses junit 4.13.2 and has a few tests.

      If I run mvn test -DexcludedGroups=SlowTest Surefire fails the build of the API module with the following error message:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M6:test (default-test) on project sample-api: groups/excludedGroups require TestNG, JUnit48+ or JUnit 5 (a specific engine required on classpath) on project test classpath -> [Help 1]

      Note, that tests in the implementation module might (or might not) use categories as explained in the documentation.

      IMHO Surefire should not fail the build in this situation as it would otherwise require one to either declare an unused dependency or configure surefire to be skipped, even if it's not used at all.

      See also https://www.mail-archive.com/users@maven.apache.org/msg143919.html.

      Attachments

        Activity

          People

            Unassigned Unassigned
            matinh Martin Höller
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: