Tuesday, November 10, 2009

Maven2 bootstrap pom.xml for SLF4J and no-commons-logging

Each time I start a new Java project with Maven 2, I need to write the same dependencies again and again: SLF4J and no commons-logging because it's evil (and SpringFramework seems to want to keep it), Joda Time by default, some properties, etc.

So, that's the template pom.xml I use for the bootstrap, if it may help anybody here (it uses logback for logging, as it's more efficient than Log4j with SLF4J, but feel free to use what you want):

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <!-- UTF-8 for everyone -->

  <description>Template for project without Commons-logging</description>

      <name>No-commons-logging Maven Repository</name>




    <!--  test -->

      All the following is related to our will to NOT use Commong-logging. Never. 
      And framework we depend on won't bring commons-loggin nether (I'm looking at
      you, stringframework).
    <!-- use no-commons-logging -->
    <!-- no-commons-logging-api, if you need it -->
    <!-- slf4j commons-logging replacement -->
    <!-- other slf4j jars -->
    <!-- using slf4j native backend -->



dont you have looooooooooooong timeouts when maven search theses inexistant dependancy ?


There should not be any non-existent dependency.

I just tried with an empty local repository, and everything was downloaded correctly (even if Maven seemed to be on the road to download the universe - two times)

Perhaps one of the repositories was down when you tried ? What was the dependency which timed out ?

  © Blogger template 'Minimalist G' by Ourblogtemplates.com 2008

Back to TOP