The following two tabs change content below.
Hi, I have written and developed this site to share my experience and ideas with other colleagues. I also started to prepare interview questions and answers for job seekers. I hope it will help you a lot.

Before to run maven command makes sure we have required software already installed. List of required software given below.

  1. Java: First you have to download and install java and after that make sure you done class path also.

For class path you can follow the http://www.javatpoint.com/how-to-set-path-in-java

  1. Maven: Similar to java you have to download maven also and extract that maven zip under any drive like c: drive or d: drive After that you have setup maven path also.

Setup maven path:

  1. Right click on computer ->properties->advance system settings->Advance tab-> Environment variables -> then add new system variable like this (here I am showing value only to edit existing value but you have to add new if it’s not there)

After that append M2E_HOME to path variable like this:

So after all please verify if maven installed successfully or not using below command in command prompt.

So now all are set and you can create maven project by command line:

 

Creating simple standalone application:

mvn archetype:generate -DgroupId=com.usoft -DartifactId=AssetManagement -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

Creating web application:

mvn archetype:generate -DgroupId=com.usoft -DartifactId=AssetManagement -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

After run this command on command prompt you will see the result like this:

By default this project will not be eclipse supported to make eclipse supportive you have to run below command s

$>Cd AssetManagement

$>Mvn eclipse:eclipse

After you can also import this project into eclipse and for build this project run below command

$> mvn clean –U package

If its success then means all are set. Now you can start your development as per your requirement.

Note: Using maven command you can create other type of project also for that you need to take more understating on Archetypes. For understanding you can follow the below link:

https://maven.apache.org/guides/introduction/introduction-to-archetypes.html

599 total views, 2 views today

2 thoughts on “Creating first maven project by maven command”

Leave a Reply

Your email address will not be published. Required fields are marked *