Skip to content

Instantly share code, notes, and snippets.

@msheiny
Last active August 29, 2015 13:58
Show Gist options
  • Save msheiny/10212036 to your computer and use it in GitHub Desktop.
Save msheiny/10212036 to your computer and use it in GitHub Desktop.
Notes from brief encounter with maven

High-level

Maven is a build automation tool for java (though it can also be used for other languages). It has the ability to pull in java libraries and maven plugins from a network repository.

All build files will go in ./target and it is a good idea to ignore that in your version control.

High-level file directory looks like this:

├── pom.xml  - define project parameters here
├── src
│   ├── main
│   │   └── java - deliverable java source code
│   └── test
│       └── java - java test source code
└── target - where all build files go

Commands

To pull in a skeleton project with maven:

mvn archetype:generate

To build a maven report site:

mvn site

To compile, run tests, and build your jar file:

mvn package

To run tests separately:

mvn test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment