I'm using Maven and the kotlin-maven-plugin
to compile code.
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>process-sources</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<sourceDirs>
<source>src/main/kotlin</source>
<source>src/main/resources</source>
<source>target/generated-sources/jooq-h2</source>
</sourceDirs>
</configuration>
</execution>
<execution>
<id>test-compile</id>
<phase>process-test-sources</phase>
<goals>
<goal>test-compile</goal>
</goals>
<configuration>
<sourceDirs>
<source>src/test/kotlin</source>
</sourceDirs>
</configuration>
</execution>
</executions>
</plugin>
The target/generated-sources/jooq-h2
directory contains Java source files. I'm following the Kotlin manual and other people's recommendation by putting the Kotlin complation in <phase>process-sources</phase>
rather than <phase>compile</phase>
. I'm (probably wrongly?) assuming that the Kotlin compiler also takes care of compiling those Java files for me.
However, on some servers (e.g. Jenkins CI), I got strange compilation error messages, such as:
[ERROR] /var/lib/jenkins/jobs/jooq-build/workspace/jOOQ-examples/jOOQ-kotlin-example/target/generated-sources/jooq-h2/org/jooq/example/db/h2/tables/Author.java:[35,37]
error: generics are not supported in -source 1.3
Why is that?