nevzheng opened a new issue, #14106:
URL: https://github.com/apache/gravitino/issues/14106

   ### What would you like to be improved?
   
   Gravitino modules use libraries they never declare. Test sources import 
JUnit, Mockito, AssertJ, Awaitility, Hamcrest, Testcontainers, Guava and others 
that reach the classpath only through another dependency. When that dependency 
changes or drops one, the build breaks somewhere unrelated, as happened when 
Testcontainers 2 removed `junit:junit` (#14105). Nothing reports this today, 
and nothing reports dependencies that are declared but unused.
   
   ### How should we improve?
   
   Adopt the rule "declare what you use", checked by the [Dependency Analysis 
Gradle 
Plugin](https://github.com/autonomousapps/dependency-analysis-gradle-plugin) 
(`./gradlew buildHealth`), in steps:
   
   1. **Warn only, on an allow list of modules.** The plugin runs in CI and 
reports used-but-undeclared and declared-but-unused dependencies per module and 
source set; nothing fails.
   2. **Fix the findings module by module**, test source sets first, and grow 
the allow list.
   3. **Enforce** used-but-undeclared for test source sets once the allow list 
covers the repository, then for main sources.
   
   Exceptions (for example dependencies that only bring runtime services) go in 
the plugin configuration with a short reason. Related: #13900, #14105.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to