1. 创建骨架工程
2. 创建archetype
mvn clean archetype:create-from-project
3. 安装骨架到本地仓库
进入骨架工程的target目录下:
cd target/generated-sources/archetype
安装到本地仓库
mvn install
4. 读取骨架配置文件
进入本地仓库对应骨架目录读取配置文件
cd repository/com/jeiker/demo4-archetype
➜ demo4-archetype cat maven-metadata-local.xml
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>com.jeiker</groupId>
<artifactId>demo4-archetype</artifactId>
<versioning>
<release>0.0.1</release>
<versions>
<version>0.0.1</version>
</versions>
<lastUpdated>20200722082347</lastUpdated>
</versioning>
</metadata>