[精讚] [會員登入]
670

specific instructions to create a maven archetype from local existing project.

Generate an archetype from the project

分享此文連結 //n.sfs.tw/16267

分享連結 specific instructions to create a maven archetype from local existing project.@外行中的外行
(文章歡迎轉載,務必尊重版權註明連結來源)
2024-02-23 16:03:02 最後編修
2023-11-10 11:47:17 By jung
 

here are the steps to create a Maven archetype from an existing project:

  1. Navigate to your project directory: Open a terminal and navigate to the directory of the existing project that you want to use as a template for your archetype.

  2. Generate an archetype from the project: Run the following command in your terminal:

    mvn archetype:create-from-project
    

    This command will create an archetype from your project.

  3. Locate the generated archetype: The generated archetype can be found in the target/generated-sources/archetype directory of your project.

  4. Install the archetype locally: Navigate to the target/generated-sources/archetype directory and run the following command:

    mvn install
    

    This command will install the archetype in your local repository.

  5. Use the archetype: Now you can use the archetype to generate new projects. Here is an example command:

    mvn archetype:generate -DarchetypeCatalog=local
    

    You will need to specify the groupId, artifactId, and version of the archetype.

Remember, the archetype contains all the files (like pom file, classes, readme, etc.) with variables that will be replaced during project generation. You can modify these files in the src/main/resources/archetype-resources/ directory of the archetype to fit your needs.

Please replace mvn with the appropriate command if you’re not using Maven directly.

END

你可能感興趣的文章

安裝netbeans9遇到的小狀況 how to show netbeans9 program onto ubuntu desktop

intellij IDEA git設定說明 whenever using git push fuction in the intellij IDEA

更新java版本後一定要做的事情 how to deal with PKIX path building failed issue after upgrade java sdk version in IDE

使用virtualbox每次都忘記的事情 share folder from win host to linux guest vm

[NetBeans]如何從git下載專案改建為自己的專案 修改git專案

如何用git log功能產生有固定格式的commit紀錄 how to create a git commit history log file with custom format

隨機好文

[NetBeans]如何從git下載專案改建為自己的專案 修改git專案

新增IDP程式使用google防機器人的驗證功能 身份認證程式新增google防機器人v2

在windows環境下強制刪除無法以檔案總管刪除的檔案或目錄 how to remove directories or files that cannot be deleted by default file manager

更新程式環境到wildfly18+openjdk11-phase2: update IDEA to jdk11 更新IDEA 編譯環境

在IDEA從JDK8升級到JDK11遇到的奇怪問題 在IDEA遇到的JAVA11函式庫引入問題