Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix][client] Make protobuf-java dependency optional in java client libraries #19

Closed
wants to merge 4 commits into from

Conversation

Shawyeok
Copy link
Owner

Fixes apache#23469

Motivation

In the Pulsar Java client libraries, the protobuf-java library is only used in ProtobufSchema, making it suitable as an optional dependency. However, it is mistakenly included in the pulsar-client-admin and pulsar-client-all shaded jar and declared as required dependency of pulsar-client, pulsar-client-original and pulsar-client-admin-original, as noted by @merlimat in this discussion.

PR apache#23468 moved protobuf-java from a shaded JAR to a declared dependency in the pom.xml, which helped avoid conflicts between protobuf-java and application dependencies. Since users only need protobuf-java when using ProtobufSchema, it makes sense to declare it as an optional dependency. This change reduces the number of dependencies in the Pulsar client libraries.

Verifying this change

  1. Execute the following Maven command:
mvn clean install -am -pl pulsar-client-all,pulsar-client-shaded,pulsar-client-admin-shaded -DskipTests
  1. Verify that the protobuf-java dependency is not included in the installed pom.xml files.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@Shawyeok Shawyeok changed the title Make protobuf-java optional [fix][client] Make protobuf-java dependency optional in java client libraries Nov 22, 2024
@Shawyeok Shawyeok closed this Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] protobuf-java should be an optional dependency for Pulsar Java client libraries
1 participant