SCANJLIB-324 Relocate bouncycastle to fix the conflict with versions already present on Gradle / AGP - #302
SCANJLIB-324 Relocate bouncycastle to fix the conflict with versions already present on Gradle / AGP#302alban-auzeill wants to merge 1 commit into
Conversation
…already present on Gradle / AGP
a61ef6d to
e9ef136
Compare
Code Review ✅ ApprovedRelocates bouncycastle into a shaded module to resolve classpath conflicts with Gradle and AGP. No issues found. OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|
antoine-vinot-sonarsource
left a comment
There was a problem hiding this comment.
Let's do it this way. It's not ideal but it looks like the best we can do in a reasonable time for now.
antoine-vinot-sonarsource
left a comment
There was a problem hiding this comment.
After the discussion we just had with @henryju it looks like this was tried before and lead to unexpected issues due to how bouncycastle uses reflection to solve providers
| <relocations> | ||
| <relocation> | ||
| <pattern>org.bouncycastle</pattern> | ||
| <shadedPattern>org.sonarsource.scanner.lib.internal.impldep.org.bouncycastle</shadedPattern> |
There was a problem hiding this comment.
| <shadedPattern>org.sonarsource.scanner.lib.internal.impldep.org.bouncycastle</shadedPattern> | |
| <shadedPattern>shaded.org.bouncycastle</shadedPattern> |
I this this is the usual pattern at Sonar (at least I remember seeing it a few times).





Summary by Gitar
bouncycastle-shadedmodule usingmaven-shade-pluginto repackagebcprov-jdk18onunderorg.sonarsource.scanner.lib.internal.impldeplibmodule dependencies and imports to use the shaded BouncyCastle artifact and package pathsThis will update automatically on new commits.