Hi,
I have a question about testExcludes and testIncludes.
My project (a clone of the kryo repo) has 2 profiles, one for >= java 8
(j8) and one for >= java 14 (j14). A test file T has to be compiled with
java 14 --preview-enabled. j8 compiles all test files except for T, j14
should only compile T. The aim is that when java 14 is available, all
tests except for T are compiled without --preview-enabled and only T is
compiled with --preview-enabled. However, when run with java 14, j14
compiles T *and* re-compiles all other tests.
I assume the testExcludes/testIncludes filters are not set correctly.
Any idea what the problem is?
Thanks!
Julia
path of T: /test/com/esotericsoftware/kryo/serializers/java14ge/T.java
original pom: https://github.com/EsotericSoftware/kryo/blob/master/pom.xml
profiles added to original pom:
<profiles>
<profile>
<id>java8ge</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<testExcludes>
<testExclude>**/java14ge/**</testExclude>
</testExcludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>java14ge</id>
<activation>
<jdk>[14,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<inherited>true</inherited>
<executions>
<execution>
<id>jdk14ge-testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<release>${java.vm.specification.version}</release>
<compilerArgs>
<arg>--enable-preview</arg>
</compilerArgs>
<testIncludes>
<testInclude>**/java14ge/**</testInclude>
</testIncludes>
<testExcludes>
<testExclude>com/**</testExclude>
</testExcludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
$mvn clean test-compile
...
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile)
@ kryo ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 41 source files to <kryo clone>/target/test-classes
...
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (jdk14ge-testCompile)
@ kryo ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 42 source files to <kryo clone>/target/test-classes
...