Maven 2 Archetype Plugin 应用
2009-12-07 12:28
190 查看
用法
Calling mvn archetype:create-from-project the plugin first resolves the package by guessing the project directory.
调用 mvn archetype:create-from-project,该插件首先从项目所在的目录通过猜测获取包
It then generates the directory tree of the archetype in the target generated-sources/archetype directory.
接着它会在目标文件夹target下的 generate-sources/archtype产生archetype目录树
在已有项目的根本目录,如你已有的工程 yourWorkspace/yourProject
如
yourProject/.project
pom.xml
.classpath
运行命令
mvn archetype:create-from-project
Then move to that generated directory and call mvn install on the created archetype.
然后移到生成的目录,同时在声称的archetype调用 mvn install
$ cd target/generated-sources/archetype/
$ mvn install
Finally move to a fresh directory and use your archetype.
最后移动到一个新的目录使用你的archetype
$ mkdir /tmp/archetype
$ cd /tmp/archetype
$ mvn archetype:generate -DarchetypeCatalog=local
参考例子
mvn archetype:generate -DarchetypeGroupId=yourCompany.yourPart -DarchetypeArtifactId=parent -DarchetypeRepository=http://xxx.xxx.xxx.xxx:8080/website -DarchetypeVersion=1.0 -DgroupId=yourCompany -DartifactId=projectId -Dversion=1.0
Calling mvn archetype:create-from-project the plugin first resolves the package by guessing the project directory.
调用 mvn archetype:create-from-project,该插件首先从项目所在的目录通过猜测获取包
It then generates the directory tree of the archetype in the target generated-sources/archetype directory.
接着它会在目标文件夹target下的 generate-sources/archtype产生archetype目录树
在已有项目的根本目录,如你已有的工程 yourWorkspace/yourProject
如
yourProject/.project
pom.xml
.classpath
运行命令
mvn archetype:create-from-project
Then move to that generated directory and call mvn install on the created archetype.
然后移到生成的目录,同时在声称的archetype调用 mvn install
$ cd target/generated-sources/archetype/
$ mvn install
Finally move to a fresh directory and use your archetype.
最后移动到一个新的目录使用你的archetype
$ mkdir /tmp/archetype
$ cd /tmp/archetype
$ mvn archetype:generate -DarchetypeCatalog=local
参考例子
mvn archetype:generate -DarchetypeGroupId=yourCompany.yourPart -DarchetypeArtifactId=parent -DarchetypeRepository=http://xxx.xxx.xxx.xxx:8080/website -DarchetypeVersion=1.0 -DgroupId=yourCompany -DartifactId=projectId -Dversion=1.0
相关文章推荐
- 使用maven集成docker构建和部署Spring Boot 应用
- maven中jetty插件的应用
- 手把手构建Maven企业级应用(整合SSI框架)《2》
- 利用gitlab、maven、docker自动构建web应用
- 利用gitlab、maven、docker自动构建web应用
- 深入理解maven及应用
- Eclipse 中应用 Maven创建Maven project
- 高效建立健壮的Android应用-Maven Android 开发
- selenium从入门到应用 - 1,环境准备(Java+TestNG+Maven+Selenium)
- 深入理解maven及应用
- 用IDEA创建maven项目使用tomcat插件方式完成web前后端应用
- Maven支撑下的War应用依赖另外一个WAR应用的解决方案
- strom学习总结——我从三个纬度开始:maven工程、徐明明博客和应用场景。
- Maven配置镜像地址 settings.xml eclipse中应用
- 项目总结--maven+springsecurity+solr+springmvc+hibernate 延迟加载处理+hibernate sql对象处理(sql执行插入)+spring注解方式+邮件 + JNDI+项目框架写法+jasperreprot的简单应用
- 手把手构建Maven企业级应用(整合SSI框架)《2》
- 学习笔记之maven2学习总结(3,maven2在淘宝项目的应用) [ 光影人像 东海陈光剑 的博客 ]
- 使用Eclipse、Maven和Hudson进行WebLogic应用开发
- Maven 搭建过程及应用
- 用Maven自动生成带有sh和bat启动脚本的java应用