Maven Basics

Maven is a build system for Java, it automaticly manages dependencies, your build process, jar file creation, the creation of javadocs and allows you to write custom extentions and templates. It uses a file called pom.xml to describe how your project will be built. This guide talks you though Maven concepts to get you started.

Creating a maven project

mvn archetype:generate

# Everything we build goes in target, let git ignore it.
echo "target/" >> .gitignore

Building a maven project

mvn clean package

Build Lifecycle

  1. Validate
  2. compile
  3. test
  4. package
  5. verify
  6. install
  7. deploy

Useful properties

Put these in your pom.xml properties section.

Standard Layout