Category

maven and log4j

For some reason log4j 1.2.15 has a compile time dependency on JMX even if you’re not going to compile log4j. Go figure. I’m not the first one to point this out since there is a bug report issued.

What’s worse is that the jars are not in any maven repository due to Sun licensing restrictions. So what do you do? There are two things you can do.

  • Install them to your local repository.
  • Say no thanks

To install the jars to your local repository:

Get the jars from Sun. Download the “JMX 1.2.1 Reference Implementation”.

Then rename them to include the version.

Then install them to your local repo:

If you also need JMS download them from Sun too.

To say “No thanks”:

You can see the log4j build dependencies at their site. Here they are.

GroupId ArtifactId Version
com.sun.jmx jmxri 1.2.1
com.sun.jdmk jmxtools 1.2.1
javax.jms jms 1.1
javax.mail mail 1.4

So, you can just say “I don’t want them” by excluding them.

One Reply to “maven and log4j”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.