Home » Posts tagged 'maven download'

Tag Archives: maven download

Newly Updated Posts

Creating Maven Project from Command Prompt

Previous Topic , In this tutorial we will learn Creating Maven Project from Command Prompt?

Creating Maven Project from Command Prompt

We can create maven project by two ways.One is by command prompt and another is by eclipse ide, let discuss the using command prompt.

Steps to create maven project from command prompt are below:

1) Open the command prompt by opening Run and type cmd and enter.

Creating Maven Project from Command Prompt- Open Command prompt

2) Take your path till the folder structure of your eclipse workspace . Type the command mvn archetype:generate and click enter. This command basically generates the maven project and take few seconds.

Creating Maven Project from Command Prompt- Move to Folder

3) Now in cmd during process of generating maven project, it will ask to choose a number, type the number same as mentioned in cmd for me its 1476

Creating Maven Project from Command Prompt- Command to create maven project

4) Again it will ask to choose a number which is basically the maven archetype version, you can choose the updated version, for me its 8. and click to enter after that it will start downloading the files for updated version to create folder structure of maven project

Creating Maven Project from Command Prompt- choose artifact name

5) Now it will ask for ‘group id’ which means you have to define the package structure to your maven project, I am defining the package as com.code2test

Creating Maven Project from Command Prompt- choose group Id

6) Next step is to define the ‘artifact Id ‘, which is basically the project name, i name it as MavenProject

Creating Maven Project from Command Prompt- Choose Artifact ID

7) Next step is to define the version, for this you have provide any number (you can give you build number of version number of your project code) , I give it 1.0 along with package propery version and hit enter.

Creating Maven Project from Command Prompt- Select Package

8) Now the step is to provide the confirmation of you maven poject, for this type ‘Y’ and enter.

Creating Maven Project from Command Prompt- Select Version

9) Now you will get the message of Build confirmation, go to your project workspace there you will see the maven project is been created on the folder structure.(As in screenshot).

Creating Maven Project from Command Prompt- Maven project created in local folder

Once your project is created it time to maven your maven project compatible with eclipse ide or in other words can imported to eclipse.

For making maven project compatible with eclipse project, firstly go to the folder structure of the recently created maven project for me its (Maven Project) and type the command mvn eclipse:eclipse and click enter

mvn eclipse:eclipse

10) Once the process of making maven project compatible with eclipse project is completed, we will get ‘Build success’ message.

Build Success

11) Now go to eclipse select-> File->import->Maven->Existing maven project and click next.

Creating Maven Project from Command Prompt- Import existing maven project

12) select newly created maven from workspace on click to ‘Browse’ button under Import Maven Projects window and click to finish.

Open Command prompt

We can see that the maven project gets imported to eclipse ide.

So following the above steps we can create maven project from CMD prompt and perform assigned task. Now in next topic we will discuss how to create maven project through Eclipse.