参考文件:
Creating an archetype from an existing project:
http://maven.apache.org/archetype/maven-archetype-plugin/advanced-usage.html
Create an archetype from a multi-module project:
http://maven.apache.org/archetype/maven-archetype-plugin/examples/create-multi-module-project.html
Steps:
1.进入项目目录(pom.xml所在的目录),运行命令
mvn archetype:create-from-project
在目录target/generated-sources/archetype下生成archetype文件
2.移动到目录target/generated-sources/archetype,运行命令
mvn install
上传archetype文件到本地仓库
3.如何已生产的archetype创建新文件, 创建新的项目文件夹,然后运行
mvn archetype:generate -DarchetypeCatalog=local
Creating an archetype from an existing project:
http://maven.apache.org/archetype/maven-archetype-plugin/advanced-usage.html
Create an archetype from a multi-module project:
http://maven.apache.org/archetype/maven-archetype-plugin/examples/create-multi-module-project.html
Steps:
1.进入项目目录(pom.xml所在的目录),运行命令
mvn archetype:create-from-project
在目录target/generated-sources/archetype下生成archetype文件
2.移动到目录target/generated-sources/archetype,运行命令
mvn install
上传archetype文件到本地仓库
3.如何已生产的archetype创建新文件, 创建新的项目文件夹,然后运行
mvn archetype:generate -DarchetypeCatalog=local
本文档详细介绍了如何使用Maven将现有项目转换为可重复使用的项目模板(archetype)。通过简单的步骤,开发者可以轻松地从单一模块或多模块项目中创建archetype,并将其安装到本地仓库,以便后续用于快速生成新项目。

被折叠的 条评论
为什么被折叠?



