生成自定义 maven 骨架步骤

2020-01-02  本文已影响0人  走在冷风中吧

首先创建自己的骨架模板, 注意不能有空文件夹, 空的会不生效!~

  1. 在模板的项目 pom.xml 加入插件

    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-archetype-plugin</artifactId>
    <version>3.0.0</version>
    </plugin>

  2. 执行maven 命令, 注意命令的执行目录是当前骨架项目
    archetype:create-from-project

之后进入到 生成好的 target -->generated-resources-->arthetype下

  1. 执行maven命令(target -->generated-resources-->arthetype)
    install

  2. 最后执行(骨架项目下)
    archetype:crawl

然后就会在本地 repository 下生成对应路径的骨架包
新建项目时添加进去即可.

上一篇 下一篇

猜你喜欢

热点阅读