We recently upgraded from Kotlin 1.1.51 to 1.2.10, cleared all the warnings (we use -Werror to treat warnings as errors), and the project is up and running. We build it from command line using mvn verify
without issues, as well as from IntelliJ using Build > Build project
.
Then, we decided to upgrade to the latest version (1.2.21), and here is where we are seeing some issues: when compiling the project from command line (mvn verify
) a warning shows up causing the compilation to fail:
[WARNING] Classpath entry points to a non-existent location: /Users/username/git/projectname/target/classes
The interesting thing is that if we do Build > Build Project
on IntelliJ, then there is no warning, and the project will compile (and run) without issues. And if we downgrade Kotlin’s version to 1.2.10 on the pom file (instead of 1.2.21), it builds successfully again from both command line and IntelliJ Build.
We noticed that when we do Build > Build Project, two directories are created in the target folder: classes and test-classes; while when the command line build fails, there are two different directories: kotlin-ic and maven-status.
Why is that difference between command line and IntelliJ build? What causes that warning, and how can we fix it?