Home > Maven, Tutorials > [Tutorial] Create, compile and test a project with Maven

[Tutorial] Create, compile and test a project with Maven

February 13th, 2011 Leave a comment Go to comments

Here is a first video tutorial about Maven, under DOS.
First i create a project based on the maven-archetype-quickstart archetype with the following command and arguments :

mvn archetype:generate 
-DgroupId=com.company.celinio 
-DartifactId=FirstTuto 
-DarchetypeArtifactId=maven-archetype-quickstart 
-DinteractiveMode=false


Archetypes are sort of templates of projects.
This command creates a folders structure and a basic Java class App.java that displays the classic “Hello World!”. It also creates a JUnit test class named AppTest.java .
The groupId corresponds to the name of the package
The artifactId corresponds to the name of the project.
Regarding the terminology, archetype is called a plugin and generate is called a goal.

Then i compile the project and run the test.

mvn compile
mvn test

The compiled classes are generated in the target folder.
Link to the video tutorial : http://www.celinio.net/tutorials/iframe.htm

More info : http://maven.apache.org/archetype/maven-archetype-plugin/usage.html

Categories: Maven, Tutorials Tags:
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.