How to start a maven project from scratch


Step 1
Open the command prompt.

Step 2
Customize following command and type in command promp.

 mvn archetype:generate -DgroupId=com.init -DartifactId=TestMavenProject




In here
-DgroupId = com.init ====> package structure
 -DartifactId = TestMavenProject  ====> project Name

When you type and press enter, the porject will create at the given location.

During the generation, several questions may ask as follows.


answered it as 1.


answered it as 1.


answered it as Y.

If everything is correct you will get SUCCESS message as follows.



Project will be created at the given location with pom.xml file.



Step 3
Search for dependancies and add to pom.xml  (maven dependancies hibernate)

Step 4
Type 'mvn idea:idea' to reload the project.

Comments

Post a Comment

Popular Posts