quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.85k stars 2.7k forks source link

quarkusAppPartsBuild fails with "Dependencies with duplicate files detected." when "-Dquarkus.container-image.build=true" in multi-module Gradle project #37858

Open mklueh opened 11 months ago

mklueh commented 11 months ago

Describe the bug

I can't build my project anymore as a Docker container, as it complains about resources that are duplicated by several transitive modules. (the normal build still works)

As far as I remember, I had that problem in the past once, and solved it by setting a DuplicatesStrategy

subprojects {
    ...
    tasks.withType<Jar> { duplicatesStrategy = DuplicatesStrategy.EXCLUDE }

}

But this does not have an impact on the quarkusAppPartsBuild task.

Expected behavior

To build accordingly / respect the duplicates strategy at least

Actual behavior

> Task :appsmy-app:quarkusAppPartsBuild
Dependencies with duplicate files detected. The dependencies [org.jetbrains.kotlin:kotlin-stdlib::jar:1.9.21[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib\1.9.21\17ee3e873d439566c7d
8354403b5f3d9744c4c9c\kotlin-stdlib-1.9.21.jar;], org.jetbrains.kotlin:kotlin-compiler-embeddable::jar:1.9.21[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-compiler-embeddable\1.9.21\a8f2d2fed3fc195beef3fab4a7fd1a844e101f0e\kotlin-compiler-embeddable-1.9.21.jar;]] contain duplicate files, e.g. kotlin/coroutines/coroutines.kotlin_builtins
Dependencies with duplicate files detected. The dependencies [my-project.components:auth::jar:unspecified[paths: C:\Users\MyPc\Workspace\my-project\components\auth\build\libs\auth.jar;], my-project.components:link::jar:unspeci
fied[paths: C:\Users\MyPc\Workspace\my-project\components\link\build\libs\link.jar;], my-project.components:settings::jar:unspecified[paths: C:\Users\MyPc\Workspace\my-project\components\settings\build\libs\settings.jar;], l
aunchbase.components:auth-base::jar:unspecified[paths: C:\Users\MyPc\Workspace\my-project\components\auth-base\build\libs\auth-base.jar;], my-project.components:file::jar:unspecified[paths: C:\Users\MyPc\Workspace\my-project
\components\file\build\libs\file.jar;], my-project.components:base::jar:unspecified[paths: C:\Users\MyPc\Workspace\my-project\components\base\build\libs\base.jar;], my-project.components:mail::jar:unspecified[paths: C:\Users\MyPc\Workspace\my-project\components\mail\build\libs\mail.jar;]] contain duplicate files, e.g. application.properties
Dependencies with duplicate files detected. The dependencies [org.jboss.logging:commons-logging-jboss-logging::jar:1.0.0.Final[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.jboss.logging\commons-logging-jboss-log
ging\1.0.0.Final\27a4e823d661bde67ec103bba2baf33cddde6e75\commons-logging-jboss-logging-1.0.0.Final.jar;], commons-logging:commons-logging::jar:1.2[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\commons-logging\commons-logging\1.2\4bfc12adfe4842bf07b657f0369c4cb522955686\commons-logging-1.2.jar;]] contain duplicate files, e.g. org/apache/commons/logging/Log.class
Dependencies with duplicate files detected. The dependencies [org.apache.camel:camel-base::jar:4.2.0[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.apache.camel\camel-base\4.2.0\3df5b66059515336fba837cf2dc72726e8e
b3bc1\camel-base-4.2.0.jar;], org.apache.camel:camel-core-model::jar:4.2.0[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.apache.camel\camel-core-model\4.2.0\784912fe9cdb76d9bcafaa3fc601f4198530abf7\camel-core-mod
el-4.2.0.jar;], org.apache.camel:camel-main::jar:4.2.0[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.apache.camel\camel-main\4.2.0\cd4581430d39861c2fa991382e6460718a1c9f56\camel-main-4.2.0.jar;], org.apache.camel
:camel-api::jar:4.2.0[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.apache.camel\camel-api\4.2.0\bb23f5f40ef06fbb3be4671de96b08f595951c19\camel-api-4.2.0.jar;], org.apache.camel:camel-xml-jaxp-util::jar:4.2.0[pat
hs: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.apache.camel\camel-xml-jaxp-util\4.2.0\e98fe34bd1ba570579fd1dc89fe7c78bc1f987b1\camel-xml-jaxp-util-4.2.0.jar;], org.apache.camel:camel-support::jar:4.2.0[paths: C:\User
s\MyPc\.gradle\caches\modules-2\files-2.1\org.apache.camel\camel-support\4.2.0\708672fd38186ac033b0bc77aefddcdc0e243413\camel-support-4.2.0.jar;], org.apache.camel:camel-componentdsl::jar:4.2.0[paths: C:\Users\MyPc\.gradle\c
aches\modules-2\files-2.1\org.apache.camel\camel-componentdsl\4.2.0\f8f0ff9ca367242717191a77df8b733fa4a245ca\camel-componentdsl-4.2.0.jar;], org.apache.camel:camel-management-api::jar:4.2.0[paths: C:\Users\MyPc\.gradle\caches\
modules-2\files-2.1\org.apache.camel\camel-management-api\4.2.0\6c93b437c3262df28b0b4c532f2b075d009e6a24\camel-management-api-4.2.0.jar;], org.apache.camel:camel-util::jar:4.2.0[paths: C:\Users\MyPc\.gradle\caches\modules-2\fi
les-2.1\org.apache.camel\camel-util\4.2.0\7178aeea1c737cfc0d67a1bee3cd1ab55ed43c49\camel-util-4.2.0.jar;], org.apache.camel:camel-core-engine::jar:4.2.0[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.apache.camel\
camel-core-engine\4.2.0\41b75c0a2f609df725bd59105f69ad08fd92e5f2\camel-core-engine-4.2.0.jar;], org.apache.camel:camel-core-reifier::jar:4.2.0[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.apache.camel\camel-core
-reifier\4.2.0\5ea84cce31ec532d00cec028e997a3528d809cc1\camel-core-reifier-4.2.0.jar;], org.apache.camel:camel-base-engine::jar:4.2.0[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.apache.camel\camel-base-engine\4
.2.0\151db21dc5e9eb89e96d5367273d6411c6955df1\camel-base-engine-4.2.0.jar;], org.apache.camel:camel-core-catalog::jar:4.2.0[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.apache.camel\camel-core-catalog\4.2.0\563d
c4331cfbe24804beaca4caab579b3377daf6\camel-core-catalog-4.2.0.jar;], org.apache.camel:camel-dsl-support::jar:4.2.0[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.apache.camel\camel-dsl-support\4.2.0\a0871911800078
feddbc83796b7183dbced5a969\camel-dsl-support-4.2.0.jar;], org.apache.camel:camel-endpointdsl::jar:4.2.0[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.apache.camel\camel-endpointdsl\4.2.0\8406460727873491ba2d0c3f7
e9f175e281bdcea\camel-endpointdsl-4.2.0.jar;], org.apache.camel:camel-microprofile-config::jar:4.2.0[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.apache.camel\camel-microprofile-config\4.2.0\2db14b7d7e94bc805973
8c9d937db6c663fda218\camel-microprofile-config-4.2.0.jar;], org.apache.camel:camel-core-processor::jar:4.2.0[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.apache.camel\camel-core-processor\4.2.0\c66d977c38c2c1222677ce475447a463ac661582\camel-core-processor-4.2.0.jar;]] contain duplicate files, e.g. other.properties
Dependencies with duplicate files detected. The dependencies [org.jetbrains.kotlin:kotlin-compiler-embeddable::jar:1.9.21[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-compiler-embeddable\
1.9.21\a8f2d2fed3fc195beef3fab4a7fd1a844e101f0e\kotlin-compiler-embeddable-1.9.21.jar;], org.jetbrains.kotlin:kotlin-reflect::jar:1.9.21[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-reflect\1.9.21\5570877dec93532519eda165abb3674ea1e07cbc\kotlin-reflect-1.9.21.jar;]] contain duplicate files, e.g. META-INF/metadata.jvm.kotlin_module
Dependencies with duplicate files detected. The dependencies [io.vertx:vertx-grpc-client::jar:4.4.6[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\io.vertx\vertx-grpc-client\4.4.6\a30f8879243f4328cca15307c097e5ff8882c
a51\vertx-grpc-client-4.4.6.jar;], io.vertx:vertx-grpc-server::jar:4.4.6[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\io.vertx\vertx-grpc-server\4.4.6\6d3ab4d68998556a89e8072d32fa4f68be90e31c\vertx-grpc-server-4.4.6
.jar;], io.vertx:vertx-grpc::jar:4.4.6[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\io.vertx\vertx-grpc\4.4.6\b70b7a57e57c33faf56c516a413be9346c2a28a4\vertx-grpc-4.4.6.jar;]] contain duplicate files, e.g. helloworld.proto
Dependencies with duplicate files detected. The dependencies [io.vertx:vertx-grpc-client::jar:4.4.6[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\io.vertx\vertx-grpc-client\4.4.6\a30f8879243f4328cca15307c097e5ff8882c
a51\vertx-grpc-client-4.4.6.jar;], io.vertx:vertx-grpc-server::jar:4.4.6[paths: C:\Users\MyPc\.gradle\caches\modules-2\files-2.1\io.vertx\vertx-grpc-server\4.4.6\6d3ab4d68998556a89e8072d32fa4f68be90e31c\vertx-grpc-server-4.4.6.jar;]] contain duplicate files, e.g. streaming.proto
> Task :apps:my-app:quarkusAppPartsBuild FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':apps:my-app:quarkusAppPartsBuild'.

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

21

Quarkus version or git rev

3.6.3

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 8.5

Additional information

No response

quarkus-bot[bot] commented 11 months ago

/cc @evanchooly (kotlin), @geoand (kotlin), @glefloch, @quarkusio/devtools