I'm invoking the "jetty:run" goal with the following plugin configuration:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.4.4.v20110707</version>
<configuration>
<scanIntervalSeconds>5</scanIntervalSeconds>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>80</port>
</connector>
</connectors>
</configuration>
</plugin>
Jetty refuses to log anything to slf4j in spite of the fact that my project declares slf4j as a dependency. If I pass "-Dorg.eclipse.jetty.util.log.DEBUG=true" to the JVM, Jetty outputs tons of logs but they seem to go to stderr instead of to slf4j. Any ideas?
Answering my own question:
Plugins don't see the project dependencies. You need to specify <dependencies>
inside the <plugin>
.
You need to specify a concrete slf4j implementation, such as logback. Specifying slf4j is not enough.
The end-result should look something like this:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.4.4.v20110707</version>
<configuration>
<scanIntervalSeconds>5</scanIntervalSeconds>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>80</port>
</connector>
</connectors>
</configuration>
<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>0.9.29</version>
</dependency>
</dependencies>
</plugin>