Create a Simple Maven Project

Open Eclipse.
Create a new maven project. File--New--Other
New Wizard will open. There go to maven icon and expand it. Then Select Maven Project item.

Click Next.
In the New Maven Project wizard, select the create a simple project (skip archetype selection) check box.

Click Next
In the New Maven Project wizard enter the following values.

Group Id: org.test.testapp
Artifact Id: testapp
Version: 0.0.1-SNAPSHOT
Packaging: jar

Click Finish.

New Maven Project will be created and display in the Project Explore.
Here is the initial project structure of the created simple Maven project with a jar packaging. 

  Pom.xml file will contain the following initial details


Run the Project

Executing Maven Goals.
Right Click on the testapp.
Select Run as
Here you can see the configured goals.
Maven install, Maven clean etc

maven install goal will install all the necessary dependancies inside pom.xml and create the packaging file which is jar or war file.

In this project we haven't done anything.

In the next post I will show you haow to create a simple spring-hibernate project.

After we creating the project inside eclipse we can run the application even through command line, if you have installed Apache Maven in to you PC.

For that you have to open commandline and go to the project directory thorugh command line and execute the mvn commands such as mvn clean, mvn install, etc.

ex: %testapp> mvn install


Popular posts from this blog

Secure Spring Boot REST API using Basic Authentication

Integrating Swagger with Spring Boot REST API

Building a RESTFul Service using Spring Boot