Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #11562
Title
Remove unused BouncyCastle dependency from Maven core build
Summary
This pull request removes the unused bcprov-jdk18on dependency from the Maven core build.
The dependency was present but not used by Maven core itself, as noted in the review comment. Maven core should not define cryptographic providers that are not strictly required, and each consuming project should explicitly declare the artifacts it needs.
Removing this dependency ensures:
A cleaner and more minimal dependency graph
Improved clarity of Maven core responsibilities
Reduced risk of unnecessary dependency resolution during builds
Background and Motivation
In the discussion on #11562, it was pointed out that:
“bcprov-jdk18on is not used by Maven core itself; each project should define needed artifacts.”
Keeping unused dependencies in Maven core is undesirable because it:
Introduces unnecessary transitive dependencies
Can cause confusion about what Maven core actually relies on
Increases the surface area for dependency resolution issues, especially in restricted or offline environments
This PR addresses that concern directly by removing the unused dependency.
What This PR Does
Removes the following unused dependency from the Maven core build configuration:
org.bouncycastle
bcprov-jdk18on
1.78.1
Does not introduce any new dependencies
Does not change runtime behavior
Verification Steps Performed
Clean build
mvn -DskipTests clean verify
✔ Build succeeds without the dependency.
Offline build verification
mvn -o -DskipTests validate
✔ No network access attempted.
Dependency inspection
mvn dependency:tree | grep bouncycastle
✔ No remaining BouncyCastle dependencies in Maven core.
Why This Change Is Safe
The dependency was not referenced in Maven core code
No APIs, tests, or plugins rely on it internally
Downstream projects remain free to declare BouncyCastle explicitly if needed
This change strictly improves build hygiene without altering behavior.
Impact
Simplifies Maven core dependency management
Avoids unnecessary cryptographic provider inclusion
Improves reproducibility and clarity of the Maven build
Branch and Update Notes
This PR is based on the master branch (correct for 4.1.0-SNAPSHOT)
The update was applied by amending the existing commit and force-pushing, as this PR was already open
No additional PR was created
Checklist
Addresses a single issue (#11562)
Change is minimal and focused
No functional behavior changes
Build and offline verification completed
Commit history updated via rebase / force-push
License
[x] I hereby declare this contribution to be licensed under the Apache License Version 2.0, January 2004.
[x] An Apache Individual Contributor License Agreement is not required for this contribution.
Removed the unused bcprov-jdk18on dependency as suggested.
Force-pushed the update to this PR.
Please let me know if further adjustments are needed.