0

In my kotlin project the resources (ehcache.xml & logback.xml config) were not getting copied to target/classes.

aygavras
  • 170
  • 2
  • 11

1 Answers1

0

Issue was with the kotlin incremental config plugin.

<kotlin.compiler.incremental>false</kotlin.compiler.incremental>

This was resolved after disabling it. Another workaround is:

<plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <version>3.0.2</version>
    <executions>
        <execution>
            <id>extra-copy-resources</id>
            <phase>process-classes</phase>
            <goals>
                <goal>resources</goal>
            </goals>          
        </execution>
        <execution>
            <id>extra-copy-test-resources</id>
            <phase>process-test-classes</phase>
            <goals>
                <goal>testResources</goal>
            </goals>          
        </execution>
    </executions>
</plugin>

Though this solution is causing extra copying.

As of now, the incremental compilation is still more of an experimental feature, so it's better to be wary of it before using it in production.

Ref: https://discuss.kotlinlang.org/t/kotlin-compiler-incremental-not-copying-resources/5640

aygavras
  • 170
  • 2
  • 11