Maven 2 Archetype Plugin 应用

用法
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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值