Create your first project with Maven

I am going to create very simple project with Maven so that you can undestand the folder structure and Project Object Model used by the Maven

First you should have installed the Maven in your computer. If you have not done it already you can refer this article.

You can open up the terminal and chnage the directory where you want to create the project. Then you can issue the following command

The artifactId parameter specifies the directory name to use as the base directory for the project.In this example it is helloworld

The groupId is the package name

Once inststalled, you can go the project folder and browse the folder structure of the project

This is the pom.xml file what you find in the root of the project

You can see the full POM file by issuing the following command in your terminal. You should change directory in your terminal to “helloworld”

How to run the application
Now you can build the project using following command

Now you can see the .jar file inside the build folder

You can issue the following command to run the project