pan3793 commented on PR #8903: URL: https://github.com/apache/hadoop/pull/8903#issuecomment-6626223341
> So following the best practice for dependency management we should declare the dependency where it is used ... I know someone calls it the best practice, Gradle even replaces the `compile` configuration with `implementation`(the module can only use the dependency classes but not its transitive dependencies at compile time) and `api`(more like Maven's `compile` scope), but I can not follow that, at least for Maven and normal Java software without using the Java Platform Module System (JPMS) - flattening all dependencies and concatenating all of them into the classpath, for example: - B depends on A v1 - C depends on A v2 - D depends on B and C, and uses A's API For Maven and normal Java software without using JPMS, you must choose one version of A, and all of B, C, and D see the pinned A version at runtime, then how does declaring A in D's pom.xml help? I don't think it solves the problem, unless it allows B, C, and D to use different versions of A at runtime. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
