Maven performs tests a 2nd time and doesn't find classes

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Maven performs tests a 2nd time and doesn't find classes

Hello everyone,


another problem, but (hopefully) not connected to the other one I posted
earlier today:


When I execute a Maven build using the goals "clean install site" or
"clean package site", I see that the maven-surefire-plugin is executed 2

The first time everything goes smoothly. But the second time it reports
an error that it can't find my classes which are needed for the tests
(obviously - as they are the ones who should be tested).



First I don't know why the tests are performed 2 times.

I read about a problem here:

I'm using v2.21.0 of the maven-surefire-plugin as well as the

I added the following at the maven-surefire-report-plugin entry in the
<pluginManagement> section:











And in the <reporting> section at the maven-surefire-report-plugin










But that didn't help much. The tests are still performed 2 times.



Second I realized that the 2nd time the tests are performed the
classpath pointing to the class (\target\classes) is missing (thanks to
the debug output).

But I don't know why that is the case.

The 1st time that classpath exists.