Hi all,
I’m trying to build an Android project using the andoird-maven-plugin and the kotlin-maven-plugin. Basically, it’s working pretty well, instead of a small issue.
The android-maven-plugin auto-generates resource classes (R.class, BuildConfig.class, …) and places them under target/classes. The kotlin-maven-plugin runs afterwards and compiles kotlin sources that reference those resources and places them also under target/classes. Unfortuantely, the directory target/classes itself isn’t on the classpath so the referenced resources are not found. As a workaround, I’ve added the target directory to the classpath by doing this…
<configuration> <sourceDirs> <source>${basedir}/target/classes</source> <source>${basedir}/src/main/kotlin</source> </sourceDirs> </configuration>
...but this implies that I do a clean before every compile, because obviously all kotlin classes would already exists if not cleaned before.
Does anyone have an idea how to fix this?
Best regards,
Philipp