官术网_书友最值得收藏!

Creating a project with Maven

Once Maven is installed and verified, you will have to create a project with Maven. This you can do in the command prompt itself. Just run the following command in your desired location, then the project will be created automatically:

mvn archetype:generate -DgroupId=com.packtpub.restapp -DartifactId=ticket-management -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false -Dversion=1.0.0-SNAPSHOT

If you face any problems while creating the project, use the –X option in Maven, shown as follows. It will point out the location where the error has occurred:

mvn –X archetype:generate -DgroupId=com.packtpub.restapp -DartifactId=ticket-management -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false -Dversion=1.0.0-SNAPSHOT

In the following points, we go through each part of the command that is used to create a Maven project:

  • archetype:generate: Use this if the goal is to create a new project on a specified archetype, in our case maven-archetype-quickstart.
  • -Dgroupid=com.packtpub.restapp: This part defines a project with a group identifier such as a package.
  • -DartifcatId=ticket-management: This part defines our project name (folder).
  • -DarchetypeArtifactId=maven-archetype-quickstart: This part will be used to select the archetype on the archetype:generate goal.
  • -Dversion=1.0.0-SNAPSHOT: The project version can be mentioned in this part. It will be helpful when you deploy the project and distribute it.
主站蜘蛛池模板: 红安县| 徐州市| 海安县| 台前县| 汽车| 监利县| 读书| 商河县| 永寿县| 双牌县| 伊宁县| 阳春市| 富平县| 辽阳市| 泽普县| 武陟县| 美姑县| 西畴县| 绥中县| 宝应县| 长乐市| 卢氏县| 宜宾市| 都安| 体育| 黔江区| 临朐县| 和顺县| 潍坊市| 翁牛特旗| 涿鹿县| 中西区| 山丹县| 普格县| 大连市| 西充县| 高邮市| 扎囊县| 商河县| 富民县| 昭平县|