archetype脚手架-本地配置 & 创建项目
maven 发布jar后,如何使用 archetype脚手架?
配置远程 archetype
配置远程 archetype
我们一般使用的是远程的 archetype-catalog.xml
但是可以先下载common-maven-archetype 的maven jar文件和依赖项,避免每次都到远程下载
终端执行:
mvn dependency:get -DremoteRepositories=http://alm.domain.cn/nexus -DgroupId=cn.domain.archetype -DartifactId=common-maven-archetype -Dversion=0.0.1-SNAPSHOT
然后,在新建项目的时候直接点击 Add Archetype
<archetype groupId="cn.domain.archetype" artifactId="remote-archetype" version="0.0.1-SNAPSHOT" repository="http://alm.domain.cn/nexus/repository/snapshots/archetype-catalog.xml" />