Closed Shawyeok closed 2 days ago
A simpler solution is to remove the configurations related to attach and unpack. IntelliJ IDEA assumes the shaded jar path is target/${artifactId}-${version}.jar. However, in Pulsar’s build system, the finalName is set to just ${artifactId} in the parent pom.xml. While I’m unsure of the reasoning behind this setup, we can override the finalName in
jetcd-core-shaded/pom.xml
. This is the approach I’ve taken in this patch.
Thank you, @Shawyeok! Great work. How did you find out that IntelliJ expects this format? Could we remove overriding of finalName
in pom.xml so that we'd use the default everywhere? It seems that the finalName was overridden already in the initial commit of Pulsar.
@Shawyeok Please submit a similar change to BookKeeper since there's a similar solution to shade jetcd-core in metadata-drivers/jetcd-core-shaded/pom.xml
.
@lhotari
How did you find out that IntelliJ expects this format?
There is a silent error in the pulsar-metadata module dependencies, which I discovered by coincidence.
Could we remove overriding of finalName in pom.xml so that we'd use the default everywhere? It seems that the finalName was overridden already in the initial commit of Pulsar.
I tried once, but other configurations depend on the current finalName
setting, such as:
https://github.com/apache/pulsar/blob/81385c5f971913f841d5637c7b8e103138fd76cc/distribution/server/src/assemble/bin.xml#L89-L89
I wasn’t sure what was beneath the surface :-) , so I opted for a conservative approach.
@Shawyeok Please submit a similar change to BookKeeper since there's a similar solution to shade jetcd-core in
metadata-drivers/jetcd-core-shaded/pom.xml
.
Sure, will do it tomorrow.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 74.35%. Comparing base (
bbc6224
) to head (8cb145a
). Report is 731 commits behind head on master.
Fixes #23513
With recent pulsar releases, it raise
NoClassDefFoundError
if setup with aetcd
metadata.Motivation
The
jetcd-core-shaded
module was introduced in #22892 to address the compatibility issues between jetcd-core’s grpc-java dependency and Netty. You can find more details here and in the grpc-java documentation.Currently, we use
unpack-shaded-jar
execution unpacks the shaded jar produced bymaven-shade-plugin:shade
into thejetcd-core-shaded/target/classes
directory. However, the classes in this directory conflict with its dependencies. If themaven-shade-plugin:shade
runs again without cleaning this directory, it can produce an incorrect shaded jar. You can replicate and verify this issue with the following commands:A simpler solution is to remove the configurations related to attach and unpack. IntelliJ IDEA assumes the shaded jar path is
target/${artifactId}-${version}.jar
. However, in Pulsar’s build system, the finalName is set to just${artifactId}
in the parent pom.xml. While I’m unsure of the reasoning behind this setup, we can override the finalName injetcd-core-shaded/pom.xml
. This is the approach I’ve taken in this patch.Verifying this change
This issue typically cannot be detected by CI tests, as CI environments always run in a clean workspace. To address this, we could refine our release guidelines to include a step for cleaning the workspace before deploying artifacts. Additionally, incorporating automated checks into the release validation process could help catch such issues early.
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: https://github.com/Shawyeok/pulsar/pull/18