参考文件:
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