Reputation: 1462
Having hard time to describe this and I bet this is something very simple, but I just can't google sollution.
I am using many modules in my project. For simple argument let's say I have modules A
and B
.
B
depends on A
.
When I add dependency to external library (using implementation
keyword) in module A
to use some of it's code in the module, I cannot access library's code in project B
. How can I achieve that? I would like A
to be my "base" project with all dependencies in that place rather than having to repeat myself in other modules, that depend on it.
Upvotes: 4
Views: 384
Reputation: 7590
The implementation
configuration means the dependencies are internal (implementation specific) for the project and should not be exposed on the compilation classpath of other dependent projects. This helps encapsulate dependencies and speeds up the build as you don't need to recompile dependent projects if you only change internal dependencies.
If you want to expose them, you need to use the api
configuration instead, along with the java-library plugin.
Upvotes: 2