- Building RESTful Web Services with Spring 5(Second Edition)
- Raja CSP Raman Ludovic Dewailly
- 189字
- 2021-06-30 19:13:25
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.
推薦閱讀
- CorelDRAW X6 中文版圖形設計實戰從入門到精通
- 物聯網短距離無線通信技術應用與開發
- 網絡故障現場處理實踐(第4版)
- Getting Started with WebRTC
- Practical Web Design
- 大話社交網絡
- Mastering Dart
- 6G無線網絡空口關鍵技術
- Selenium WebDriver 3 Practical Guide
- Qt5 Python GUI Programming Cookbook
- Professional Scala
- 算力網絡:云網融合2.0時代的網絡架構與關鍵技術
- 新IP:面向泛在全場景的未來數據網絡
- Corona SDK Application Design
- 網絡信息安全工程技術與應用分析