Friday, February 22, 2008

Use Maven to manage project of any size

The moment I started using Maven instead of Ant I had decided that I am going to use this tool from now on. The foremost thing that excited me was that I did not have to bother about how to write build script to compile and test projects. Maven is a plug-in based software project management and comprehension tool. It manages project build to reporting and documentation.
Getting bare infrastructure to start a project is just a command line away. For example to begin with simple Java project one would need to type
mvn archetype:create -DartifactId=my-app
Read this five minutes guide to scratch the surface of Maven.

Maven frequently used commandsmvn compile - compiles source code
mvn test - runs test cases
mvn clean - deletes target folder (use this to perform clean build)
mvn package - builds the project and runs all the test cases
mvn install - installs the project in local repository
mvn eclipse:eclipse - generates eclipse project files
mvn eclipse:clean - clears eclipse project files

Some Maven Tips and Tricks


  1. Good article :)
    One thing to update is that the link is now obsolete. It should now be