common icon indicating copy to clipboard operation
common copied to clipboard

Build failure on project common-utils: groups/excludedGroups require TestNG or JUnit48+ on project test classpath

Open landon9720 opened this issue 6 years ago • 7 comments

On the master branch:

mvn install
...
[INFO] Reactor Summary for common 5.4.0-SNAPSHOT:
[INFO] 
[INFO] assembly-plugin-boilerplate ........................ SUCCESS [  0.442 s]
[INFO] Build Tools ........................................ SUCCESS [  0.358 s]
[INFO] common ............................................. SUCCESS [  1.048 s]
[INFO] utils .............................................. FAILURE [  0.620 s]
[INFO] metrics ............................................ SKIPPED
[INFO] config ............................................. SKIPPED
[INFO] common-logging ..................................... SKIPPED
[INFO] confluent-log4j-extensions ......................... SKIPPED
[INFO] confluent-log4j2-extensions ........................ SKIPPED
[INFO] package ............................................ SKIPPED
[INFO] Common ............................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.721 s
[INFO] Finished at: 2019-06-04T15:12:11-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project common-utils: groups/excludedGroups require TestNG or JUnit48+ on project test classpath -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :common-utils

I have successfully built Kafka with ./gradlew installAll. Any troubleshooting tips?

landon9720 avatar Jun 04 '19 22:06 landon9720

How did you manage to solve this problem? I also faced with it

H1ght0wer1 avatar Sep 30 '19 08:09 H1ght0wer1

I am also facing the same issue can someone tell me how to resolve it?

Kaurgurjot avatar Mar 17 '20 12:03 Kaurgurjot

I am also facing similar issue. ``[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project dtp-loft-tests: groups/excludedGroups require TestNG or JUnit48+ on project test classpath -> [Help 1] [ERROR]

anhtv08 avatar Apr 28 '20 07:04 anhtv08

@Kaurgurjot @anhtv08 I was able to get around this error by adding junit as a dependency in pom.xml to include it in my project like so

<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.12</version>
    <scope>test</scope>
</dependency>

however this was in the context of smaller avro registry maven project I'm getting up and running and not related to this common-utils project.

Not sure if this is the valid solution but thought I'd share how I got through it!

NicolasMilligan avatar Apr 29 '20 00:04 NicolasMilligan

If you're using junit 5, the addition of the following dependency should solve the problem.

<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-engine</artifactId>
    <version>5.7.0</version>
    <scope>test</scope>
</dependency>

plumstone avatar Oct 30 '20 10:10 plumstone

Just had same problem, one module failed on build. It hasn't any tests in it, but has empty src/test/java folder with some empty packages and empty src/test/resources. I completely removed src/test folder, now build is successful.

Dedmikash avatar May 28 '21 16:05 Dedmikash

If you delete the target folder it works.

arianapaz avatar Feb 14 '24 21:02 arianapaz