Installation you’ll really have to figure out yourself, is no more than unzipping package and setting some path variables.
Create your first project by the following commands
mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
With the create goal you can generate the basic project structure and a basic pom file. The cd (change directory) was only to get yourself in your new project folder in order to continue.
To get this project into eclipse simply execute the following command.
You can then import the project into eclipse as an existing java project. Dependencies will then be added to the classpath for your eclipse project (you might have to set the M2_REPO variable in eclipse to point to your maven repository). If you don’t like the command way you can look for the maven eclipse plugin. This enables you to graphically manage your dependencies from within eclipse.
Then you can start developping, to compile use
You’ll see that your junit tests form the test packages are executed before compiling the project itself. This is how it should be so keep your tests up to date.
Once the project is stable you can package project facets into jar with
To be able to use this jar as a dependency in one of your next projects you can install the jar into your repository
So far all of this was very straight forward. Now we’ll get into more realistic situations with version control and release management.
Let us first configure our version control so we’ve got something to fall back to when we have a bad day. If you haven’t any svn set up you can read the subversion setup post. Therefore add the following lines to your pom file
Also you’ll want to deploy a complete project … parent pom
war and ear packaging