Why did no-one tell me about... Maven?!

Tags: java programming maven

Added: 2011-11-18T21:04:42

Why did no-one tell me about... Maven?!

If you're like me, and you've been struggling with Java build systems, such as NetBean's inbuilt one, or Ant, let me tell you - check out Maven.

Everyone's been using it for ever, so it's properly tested, and widely supported.
You add libraries by defining dependencies in Maven, and it takes care of going and getting them.

All you have to do to start using it, is shovel your code around to fit this directory structure:

Grab a copy of Maven (go with 2.2 for now), and stick this starter pom.xml in the directory too:
then run:
mvn test install
and it should spit something out into the target directory.

OK, it's not *quite* that easy. However, you will just need to add the dependencies as more XML in your pom.xml file. Say that last command complains that
package org.apache.commons.lang does not exist
Simply Google for: maven org.apache.commons.lang, and it will direct you to a page on which has the relevant XML excerpt to add to your pom.xml.

Anyway, use it.

posted by Calum on 2011-11-18T21:00 under

Add a comment

Your IP:
Please enter 4884125 here: