Closed Deraen closed 6 years ago
Adding slf4j-nop
to a project dependencies do not silence the warning, maybe this is running on a pod and we can add it there?
Fixed by 7709941bcef20de55b940ec18885677df33b7557
I think it's OK to add the slf4j-nop jar to the worker pod because its deps don't interfere with user deps (worker pod classpath is totally isolated)
New pomegranate uses new maven-resolver (aether) which uses slf4j-api for logging:
This means that when it tries to log, it will check if classpath contains any logger implementations. We can't safely add new implementations as it is probably that users do that themselves, and having multiple loggers also causes warning.
Though Maven itself seems to include logger: http://maven.apache.org/ref/3.2.2/maven-embedder/logging.html Might be worth to investigate more on how they prevent warnings.
Some notes from Slack:
Maybe we'll need code to check project deps and only add logger if there isn't one
Or maybe slf4j-api has some method to check if logger is available... and then we can inject logger... if we can do that before it prints the warning, it would probably be most robust solution
https://github.com/qos-ch/slf4j/blob/master/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java#L149
If we can manage to run code before Maven-resolver classes are loaded, we can use
java.util.ServiceLoader.load
to check forSLF4JServiceProvider
and if none is found, add nop/simple logger to classpath