0

Tools :

Maven 3

JUnit 3

Issue :

I have a legacy project which uses JUnit 3. I have created a new test module with src/test/java as project structure and added JUnits 3 classes inside it.

JUnits classes follow correct naming convention as - Test*.java

But when I run mvn clean test , maven is not picking up the tests.

It seems no tests to run message is also not coming given by maven-surefire-plugin

Can anybody please advice what is the issue here ?

I am really not able to find why tests are not picked up

Atul
  • 1,560
  • 5
  • 30
  • 75
  • If you added tests to a legacy project, then are there old tests already? Do those run? If so, you could compare your new ones and the old ones. Also try running "mvn -X clean test" to figure out what's happening. – pitseeker Apr 18 '18 at 11:17
  • I haven't added any new tests. These are existing ones . I just moved them to a new folder structure to get picked by maven – Atul Apr 18 '18 at 11:25
  • Running mvn -X clean test is not listing running of surefire plugin – Atul Apr 18 '18 at 11:34
  • The name of the class should be `xxxTest` – diginoise Apr 18 '18 at 12:09

1 Answers1

0

There was a mistake in pom.xml .

The packaging was declared as <packaging>pom</packaging>

The packaging is changed to jar and it started working

Atul
  • 1,560
  • 5
  • 30
  • 75