Skip to content

Fix potential class conflict during jetcd-core-shaded shading process - #4532

Merged
dlg99 merged 1 commit into
apache:masterfrom
Shawyeok:fix-jetcd-shading-issue-2
Feb 14, 2025
Merged

Fix potential class conflict during jetcd-core-shaded shading process#4532
dlg99 merged 1 commit into
apache:masterfrom
Shawyeok:fix-jetcd-shading-issue-2

Conversation

@Shawyeok

Copy link
Copy Markdown
Contributor

Motivation

This a make up patch for #4526, which missed the root cause to fix potential jetcd-core shading problem.

Because the maven-shade-plugin includes the current project artifact during the shade process. In jetcd-core-shaded, we copy io.etcd.jetcd.* into the jetcd-core-shaded jar without relocation. As a result, when the install or deploy goals are executed without cleaning the target folder, class conflicts arise between io.etcd.jetcd.* inside org.apache.bookkeeper.metadata.drivers:jetcd-core-shaded.jar and io.etcd:jetcd-core.jar.

Verifying this Change

To verify this patch, follow these steps:

# Step 1: Clean and install the `jetcd-core-shaded` module.
mvn clean install -pl metadata-drivers/jetcd-core-shaded -DskipTests

# Step 2: Install without cleaning, simulating a build release process.
mvn install -pl metadata-drivers/jetcd-core-shaded -DskipTests

# Step 3: Unpack the shaded jar into a directory and verify imports.
# Ensure that the import statement for `io.netty.handler.logging.ByteBufFormat` 
# in `org/apache/pulsar/jetcd/shaded/io/vertx/core/net/NetClientOptions.class` 
# is correct. The expected import is:
# `import io.grpc.netty.shaded.io.netty.handler.logging.ByteBufFormat;`.
unzip $M2_REPO/org/apache/bookkeeper/metadata/drivers/jetcd-core-shaded/<VERSION>/jetcd-core-shaded-<VERSION>.jar \
  -d metadata-drivers/jetcd-core-shaded/target/shaded-classes

@lhotari lhotari left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you @Shawyeok

@StevenLuMT

Copy link
Copy Markdown
Member

ci fail for timeout,retry again
image

@StevenLuMT

Copy link
Copy Markdown
Member

rerun failure checks

@StevenLuMT StevenLuMT closed this Feb 14, 2025
@StevenLuMT StevenLuMT reopened this Feb 14, 2025
@StevenLuMT

StevenLuMT commented Feb 14, 2025

Copy link
Copy Markdown
Member

reopen's reason: rerun failure checks

@dlg99
dlg99 merged commit 7855518 into apache:master Feb 14, 2025
@hangc0276 hangc0276 added this to the 4.18.0 milestone May 27, 2026
@hangc0276 hangc0276 added the dependencies Pull requests that update a dependency file label May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants