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

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.
主站蜘蛛池模板: 武乡县| 屏边| 平江县| 清丰县| 丁青县| 肥西县| 资源县| 若羌县| 繁昌县| 丹巴县| 嘉义县| 福州市| 蓬莱市| 肥西县| 内黄县| 台江县| 新源县| 深州市| 孙吴县| 外汇| 伊春市| 宣化县| 凌源市| 五家渠市| 东城区| 河间市| 岗巴县| 宁河县| 新昌县| 平原县| 平阳县| 工布江达县| 兴文县| 登封市| 三河市| 三亚市| 咸丰县| 施甸县| 喀喇沁旗| 丹寨县| 通辽市|