Our application uses slf4j, but has dependency to
- slf4j api
- slf4j over log4j
- log4j
The problem is that very often IDE imports classes from log4j and not from slf4j. Ideally, i want to have only slf4j api as a maven dependency for my application and pack slf4j binding with log4j only at the time i building a war.
I found several solutions so far:
- Add libs to WEB-INF/lib folder. This is bad, because i have no maven dependency control and have to store binary in my repo which is not the best thing to do.
- Use maven-war plugin with overlays. But as i understand adding dependency to overlay will require to declare dependency (at least as compile)
Is it ok to have only dependency for slf4j api? How to package other dependencies to war without declaring them as project dependencies?
Thanks!
Logger
andLoggerFactory
classes are needed to import, which are form slf4j. – Abimaran Kugathasan