Thursday, December 18, 2008

Simple Maven Archetype

I've been doing more and more with Maven lately. We're currently beginning the effort to migrate some of our stuff to Maven at work. A new feature of the archetype plugin was introduced a bit ago to generate java projects from a menu. This is done using mvn archetype:generate. This provides you with a (hideous) menu of options to begin a new project from a template.

The problem I have with this (besides the menu being hideous) is that Maven still defaults the compiler to use source/target settings for java 1.4. Every project I do that uses Java 1.5 needs to have the compiler config settings tweaked to allow the use of 1.5. It is really annoying, so I created my own simple archetype that I can use and uploaded it to github for easy access. http://github.com/raykrueger/simple-archetype/tree/master

This new archetype generates an empty project with compiler settings for 1.5, includes the dev.java.net maven repository and has dependencies for slf4j and junit.

I may move this archetype project in the future into a collection of archetypes. So I can have a simple java one, a webapp one, and whatever else I come up with. If I do move them, I'll update this blog :)

No comments: