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

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.
主站蜘蛛池模板: 南京市| 惠东县| 东乡族自治县| 嘉定区| 平南县| 武山县| 吴桥县| 清原| 正宁县| 本溪市| 大埔区| 大化| 芒康县| 神农架林区| 宁陕县| 忻城县| 浠水县| 合肥市| 大田县| 威海市| 双鸭山市| 石家庄市| 潼关县| 平利县| 准格尔旗| 游戏| 五华县| 赞皇县| 上蔡县| 仁怀市| 乾安县| 平舆县| 南部县| 屯留县| 华宁县| 海盐县| 东乡族自治县| 谷城县| 栾川县| 固始县| 兴山县|