You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use Kotlin's documented Maven setup to compile Kotlin before Java #881
We get Kotlin compiled before javac by binding the Kotlin executions to earlier phases: compile runs at process-sources, and since #879test-compile runs at process-test-sources. #879 needed that so ResolverMethodsTest.java could call the Kotlin assertEveryFieldResolves helper. Without it, javac compiled the Java tests before any Kotlin test class existed.
It works, but it isn't how Kotlin's docs say to do it. The Maven guide has two options:
<extensions>true</extensions> on kotlin-maven-plugin, declared before maven-compiler-plugin. It adds the Kotlin executions itself, and the docs say not to configure the compiler plugin's executions with it.
Keep the Kotlin executions at compile / test-compile, set default-compile and default-testCompile to <phase>none</phase>, and add java-compile / java-test-compile executions after Kotlin.
Do this after the Java 17 bump in 15.0.0 (Jackson 3 needs it, #810). The bump removes the two things that made the second option look like the better fit:
The java17-tests profile and its java17-test-compile execution go away, since src/test/java17 can move into the regular test sources.
The useModulePath=false override on default-testCompile should go too. Its comment blames javac before Java 16 ignoring the module descriptors of multi-release jars, which doesn't apply with release 17. Not verified yet though.
So the first option is probably the simplest one at that point. Either way module-info.java and the release profile's source and javadoc jars have to keep working.
Activity