Separate jar with tests to scan to avoid Surefire breakdown
<profiles>
<profile>
- <!-- Build *-fat-test.jar file that includes all classes and resources
- that are part of the class path during test and put it inside a zip:
+ <!-- Build *-fat-test.jar file that includes all non-test classes and resources
+ that are part of the class path during test and and test.jar that includes
+ all test classes and resources, and put it inside a zip:
1. application classes and resources
2. test classes and resources
3. classes and resources in all dependencies of both (1) and (2)
- 4. copy the fat-test-jar to application-test/artifacts directory
+ 4. copy the fat-test-jar and test-jar to application-test/artifacts directory
5. zip application-test -->
<id>fat-test-application</id>
<build>
<resource>
<directory>target/classes</directory>
</resource>
- <!-- test classes and resources, see 2. above -->
- <resource>
- <directory>target/test-classes</directory>
- </resource>
</resources>
</configuration>
</execution>
<version>3.1.0</version>
<executions>
<execution>
+ <id>fat-test-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
<classifier>fat-test</classifier>
</configuration>
</execution>
+ <execution>
+ <id>test-jar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
</executions>
</plugin>
<plugin>
<copy file="target/${project.artifactId}-fat-test.jar"
todir="target/application-test/artifacts/" />
+ <!-- copy slim test-jar to application-test artifacts directory, see 4. above -->
+ <copy file="target/${project.artifactId}-tests.jar"
+ todir="target/application-test/artifacts/" />
+
<!-- zip application-test, see 5. above -->
<zip destfile="target/application-test.zip"
basedir="target/application-test/" />
