smallrye-pulsar cannot publish message in sample Quarkus project #2567
-
Hello, The project cannot publish because of this error:
build.gradle
implementation
Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 2 replies
-
Are you running it on JVM or native binary? |
Beta Was this translation helpful? Give feedback.
-
Also a dependency tree would help, because that class is available in the |
Beta Was this translation helpful? Give feedback.
-
I did further tests, it only happens with Gradle. The same identical
project with the same dependencies works fine on Maven.
I will send a dependency tree soon.
…On Wed, 7 Feb 2024 at 11:25, Ozan Gunalp ***@***.***> wrote:
Also a dependency tree would help, because that class is available in the
org.apache.bookkeeper:circe-checksum module pulled by the
pulsar-client-original dependency.
—
Reply to this email directly, view it on GitHub
<#2472 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACA2RWV53FO42VGTE7AWB53YSNJBDAVCNFSM6AAAAABCXEC4USVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZRG4ZTIOBSHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
JVM
…On Wed, 7 Feb 2024 at 11:18, Ozan Gunalp ***@***.***> wrote:
Are you running it on JVM or native binary?
—
Reply to this email directly, view it on GitHub
<#2472 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACA2RWXEBCGI35JUDF5FZATYSNIGTAVCNFSM6AAAAABCXEC4USVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZRG4YTSOJRGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Interesting, they are all compile-time dependencies, I don't see how Gradle can resolve it differently. |
Beta Was this translation helpful? Give feedback.
-
Just tried with two brand-new Maven and Gradle projects, created from the Quarkus "New project" wizard in IntelliJ IDEA using Quarkus 3.7.2. Attached the two dependency trees. |
Beta Was this translation helpful? Give feedback.
-
After much searching, I found out why this happens. It is not obvious but possible to resolve this. The problem stems from the fact that the dependency artifact resolution in Maven and Gradle are different when it comes to the default packaging of transitive dependencies. In Maven, the dependency type defaults to "jar". But in Gradle, a dependency is resolved by default to the type marked in the artifact description. For example, the So as to the resolution, I think the easiest way is to adjust the dependency resolution strategy in Gradle. You can either add explicit dependencies to the
or add dependency substitutions like
Even in Kotlin DSL I find advanced Gradle configurations are insanely complex so I'd suggest just declaring explicit dependencies. |
Beta Was this translation helpful? Give feedback.
-
@ozangunalp should we explicitly declare that dependency in the Pulsar connector extension (runtime)? |
Beta Was this translation helpful? Give feedback.
-
@cescoffier It won't change anything. The transitive dependency is already declared with jar type, default in Maven. Gradle doesn't resolve it as |
Beta Was this translation helpful? Give feedback.
-
@ozangunalp great find! Thanks. |
Beta Was this translation helpful? Give feedback.
-
Should I open an issue with Quarkus to update the docs? |
Beta Was this translation helpful? Give feedback.
After much searching, I found out why this happens. It is not obvious but possible to resolve this.
The problem stems from the fact that the dependency artifact resolution in Maven and Gradle are different when it comes to the default packaging of transitive dependencies.
In Maven, the dependency type defaults to "jar". But in Gradle, a dependency is resolved by default to the type marked in the artifact description. For example, the
org.apache.bookkeeper:circe-checksum
artifacts packaging in pom file isnar
, but there are artifacts published with typenar
jar
, see https://repo1.maven.org/maven2/org/apache/bookkeeper/circe-checksum/4.16.1/.Therefore in Maven the transitive dependency is …