Kotlin.compiler.incremental not copying resources


I think it may be a bug

mvn clean compile install
find . -name ‘log4j.properties’

But , when setting kotlin.compiler.incremental to true
mvn clean compile install
find . -name ‘log4j.properties’

NOT output to target/classes



$ mvn -version
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)
Maven home: /Users/smallufo/maven
Java version: 9, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
Default locale: zh_TW, platform encoding: UTF-8
OS name: “mac os x”, version: “10.13.1”, arch: “x86_64”, family: “mac”


Same issue here. Seems to be a bug. When is it fixed?


This issue is confusing. I thought resources were copied by maven-resources-plugin. How can it be possibly affected by compiler configuration?


I got into the same problem. The incremental compilation cleans the target/classes and target/testClasses directories. maven-resources-plugin is run before and so the resources are all gone.

This is definitely a bug and very hard to find :confused:


In that case, this might be a possible workaround (although the resources would be copied twice in this scenario):



Run into the same issue using version 1.2.21 of the compiler plugin and wasted hours before randomly trying this after determining that if I did a ‘clean’ and then ‘package’ the resources weren’t there, but doing another ‘package’ retained them, and figured it might be something to do with Kotlin not recompiling anything the second time around.

This used to work however as I have jar files that contain these missing resources, but reverting to earlier versions of my POM with earlier plugin versions didn’t seem to fix it. It feels like something else is involved but this was the only consistent factor I could find