build: guard against duplicate classes using dependency analysis plugin#15341
build: guard against duplicate classes using dependency analysis plugin#15341sanjana2505006 wants to merge 1 commit intoapache:7.0.xfrom
Conversation
|
I appreciate the PR for this but the examples show this as a settings plugin. We also have 4 separate gradle projects that use composite builds to combine into one (technically forge) so this change is incomplete. We also need to spend time testing this. Can you please hold off on implementing newly opened tickets in the future? Or at least check before proceeding? This is one of those tickets that needed more investigation. While that plugin is probably the right immediate solution, we haven't discussed this in the weekly yet. |
|
@jdaugherty Thank you for the context, I appreciate you explaining the broader setup and the concerns around the composite builds. Thank you again for the guidance. |
|
I am going to convert this review back to a draft since this isn't complete. |
This PR introduces the Dependency Analysis Gradle Plugin (DAGP) to the build system to identify and guard against duplicate classes. This addresses the security risks associated with "Maven-Hijack" type attacks and helps ensure deterministic runtime behavior by preventing multiple dependencies from providing the same fully qualified class names.
Key Changes:
com.autonomousapps.dependency-analysisplugin (v3.5.1) to the root project.:grails-coremodule to provide a targetted security guard for the main codebase.failin thedependencyAnalysisblock to ensure any detected duplicates break the build.Verification: Ran
./gradlew :grails-core:projectHealth, which successfully caught an existing duplicate class conflict in the:grails-coremodule (betweenjcl-over-slf4jandspring-jcl). This confirms the guard is active and effective.This PR fixes #15329