is there a right way to add a requirement on libra...
# community-support
c
is there a right way to add a requirement on libraries in gradle plugins that gradle provides, e.g. maven equivalent of "provided" example slf4j
v
Not sure what you mean. Like Maven
provided
would be
compileOnly
. But that his nothing to do with
slf4j
. On that you just depend.
c
when something is "provided" it is supposed to be available at runtime too
it is provided by the consumer
I got classpath hell using implementation sl4j
v
Yes. From the view of the project it is
compileOnly
though. And slf4j is not supposed to be provided.
c
it is provided by gradle
v
Ah, got you wrong. But still it shouldn't be a problem usually. But if it is, just use
compikeOnly
, where is the problem?
c
well... you do know that "provided" means the dependency is required and not optional. where-as compileOnly means it's not required at runtime. provided obviously means required at runtime.
v
well... you do know that "provided" means the dependency is required and not optional.
Yes
where-as compileOnly means it's not required at runtime.
No You do the same error Maven does. They mix the recipe to build the software with the recipe to consume the software. Your statement does the same. To build the software a "provided" lib is only needed at compile time, so
compileOnly
. The "provided" in the pom is just a documenting comment for the consumer telling "you need to provide this at runtime".