Tons of `Copying or archiving duplicate paths with the default duplicates strategy has been deprecated. This is scheduled to be removed in Gradle 7.0.`

As titled, I get tons of this warnings, if I run glm:assemble --warning-mode all:

Copying or archiving duplicate paths with the default duplicates strategy has been deprecated. This is scheduled to be removed in Gradle 7.0.

project is here

any hints?

I think it is caused by compileKotlin { destinationDir = compileJava.destinationDir }.

Try removing it and add "--patch-module", "$moduleName=${sourceSets["main"].output.asPath}" to the compilerArgs for compileJava instead.

I haven’t worked with JPMS and Kotlin yet myself, so I am not sure what the “right” way of going about it is.

Thanks @Bjorn_Vester, it looks like yours suggestions work fine

I had to restore destinationDir, because in a multi-module project it complains as:

module-info.java:2: error: package is empty or does not exist

I fixed it by adding:

jar { duplicatesStrategy = DuplicatesStrategy.EXCLUDE }

Is this fine or considered a trick?

Thanks for the suggestion, I added it as well and it works. I would not considered it a “trick”, to me it looks more like forcing Gradle 6.X to start behaving like Gradle 7.X will. If not allowing duplicates causes a problem with a project and is fixed now, then the likelihood you will have a problem in 7.X should be low.