logback-core dependency should have `provided` scope
See original GitHub issueGiven that logback-core
is indeed provided at runtime and README clearly states that as a (rather obvious) requirement, it would be cleaner to classify the former as provided
-scope dependency.
This would also allow various custom/in-house libraries that extend logstash-logback-encoder
to avoid introducing logback-core
as transitive compile-scope dependency into their customers’ class path (currently one has to specifically exclude logback-core
to achieve that).
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
logback-core dependency should have provided scope #288
Given that logback-core is indeed provided at runtime and README clearly states that as a (rather obvious) requirement, it would be cleaner ...
Read more >Maven Test Scope - java - Stack Overflow
Exclude logback-core when including myproject1 : ... Run mvn dependency:tree to see origin of your dependencies and their scope.
Read more >Maven dependency declaration - Logback - QOS.ch
To use logback-classic in your Maven project, declare the following dependency in your project's pom file. TRANSITIVITY Note that in addition to logback- ......
Read more >A Guide To Logback - Baeldung
Logback is one of the most widely used logging frameworks in the Java Community. It's a replacement for its predecessor, Log4j.
Read more >Maven Scopes and Gradle Configurations Explained
We can use the provided scope to declare a dependency that will not ... API (like slf4j-log4j12 or logback-classic ) to the runtime...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @philsttr, thank you for your detailed explanation!
Striking a balance between convenience and correctness/flexibility is often a tricky challenge, indeed. In this particular case, however, it might be quite simple.
The reason is that for the majority of
logstash-logback-encoder
consumers (using it for logging) the consumers would still have to explicitly declare eitherlogback-classic
orlogback-access
(or both) as theirruntime
scoped dependencies - simply relying on the transitivelogback-core
dependency oflogstash-logback-encoder
would not be enough in most cases I can think of (is there a popular way to use purelogback-core
directly?).Given that (and the possibility of
logback-core
version mismatch between customer customer-declaredlogback-classic
and the one potentially coming fromlogstash-logback-encoder
), I would argue that categorizinglogback-classic
asprovided
scope (in this library) would not harm the convenience, at all, in the typical basic use case.Thank you!