Abhilash V
01/17/2025, 11:42 AMSreenivas
01/17/2025, 11:55 AMapi
configurations will be transitively exposed to consumers of the library, and as such will appear on the compile classpath of consumers. Dependencies found in the implementation
configuration will, on the other hand, not be exposed to consumers, and therefore not leak into the consumers' compile classpath. This comes with several benefits:
• dependencies do not leak into the compile classpath of consumers anymore, so you will never accidentally depend on a transitive dependencyBenedikt Ritter
01/17/2025, 2:31 PMBenedikt Ritter
01/17/2025, 2:32 PMThomas Broyer
01/17/2025, 3:58 PMthe produced POM file only putsBut given that I do know it indeed works that way, what the OP describes doesn't really make sense unless I'm misunderstanding what they're trying to do and/or experiencing. TL;DR: @Abhilash V Can you give more details?dependencies into the compile scope and the remainingapi
dependencies into the runtime scopeimplementation
Abhilash V
01/17/2025, 4:13 PMThomas Broyer
01/17/2025, 4:19 PMbase
would have to be downloadable and available at runtime at a minimum. api/implementation would at most hide it from the compile classpath, but consumers could still add a direct dependency to it if they wanted, and/or access the classes through reflection.Abhilash V
01/18/2025, 1:16 PMconsumers could still add a direct dependency to it if they wanted, and/or access the classes through reflection.Consumers adding directly or accessing the class via reflection is not a problem. What I want is any of consumers that uses "*Login*" SDK alone should not be able to view/access classes in "*base*". Is it possible to achieve that?
Thomas Broyer
01/18/2025, 1:42 PMbase
as an implementation
dependency is supposed to work that way. And the maven-publish
plugin should generate a <scope>runtime</scope>
dependency for it so it should work that way when depending on the Login SDK in a Maven project.Abhilash V
01/18/2025, 3:28 PMAbhilash V
01/18/2025, 3:56 PM