Hi Aaron,

On 30/01/07, Aaron Digulla <[EMAIL PROTECTED]> wrote:
This should be an FAQ but I couldn't find anything: How do I connect a
dependency of a mojo which uses commons-logging to the Maven logging?

In my case, I'm using the jasperreports mojo which uses the
jasperreports JARs which depend on commons-logging. Since nothing is
specified, commons-logging searches the classpath, finds log4j (from
the project which is being compiled) and tries to use that which leads
to "Please initialize the log4j system properly."

I've experimented with connecting the commons-logging from tomcat to
the maven log for the tomcat:run goal.  It's not ideal (singleton
initialiser) but hey, nor is commons-logging ;)

Have a look at the JCL adapter here:

http://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox/tomcat-maven-plugin/src/main/java/org/codehaus/mojo/tomcat/log/
http://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox/tomcat-maven-plugin/src/main/resources/META-INF/services/

And it's usage here:

http://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox/tomcat-maven-plugin/src/main/java/org/codehaus/mojo/tomcat/AbstractRunMojo.java

I've been meaning to see if other plugins would be interested in using
this and maybe moving it out to maven-shared.  I'd hope there's a
nicer plexus way for the adapter to share the current maven log, so
I'm open to any suggestions.

Cheers,

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to