Fork me on GitHub jcabi

23-Sep-2013 0.8

Maven Log binding for SLF4J

Maven Log to SLF4J binding is implemented with StaticLoggerBinder singleton. This is how you use it in your Maven plugin:

import com.jcabi.log.Logger;
import org.apache.maven.plugin.AbstractMojo;
import org.slf4j.impl.StaticLoggerBinder;
public class MyMojo extends AbstractMojo {
  public void execute() {
    // ... later ..., "hello, world!");
    // and you can still use the usual logging mechanism
    this.getLog().info("hello again");

The call will go to Maven Log through SLF4J.

Since 0.7.12 log stream is forwarded to SystemStreamLog if StaticLoggerBinder.setMavenLog() is not called. In earlier versions a runtime exception was thrown.

The only dependency you need (you can also download jcabi-maven-slf4j-0.8.jar and add it to the classpath):


Cutting Edge Version

If you want to use current version of the product, you can do it with this configuration in your pom.xml:


Copyright © 2012-2013, All Rights Reserved. Privacy Policy.

site is built by Apache Maven