1

I have wrote a test suite in Junit. In test suite, I have tests from my other packages and from a dependecy. I have defined this dependency in pom.xml.

When i run tests from intellij all tests run normally, and no problem.

But when i try to run tests from command line, only my local tests are run and dependency tests are not run.

How can i solve this issue?

Bilal Yasar
  • 947
  • 2
  • 11
  • 24

1 Answers1

0

Maven, by default, try to execute only tests which are located under src/test/java. It does not executes tests, which are located in the other modules you have dependencies to.

So you need to either move tests to the current module or try to copy (or extract them if they are in a jar file) in temp dir like target/other-tests as a step of the build process and add this directory as source dir for test classes (testSourceDirectory property of the surefire plugin).

dds
  • 2,335
  • 1
  • 31
  • 45