maven flatten-maven-plugin 插件简单说明

maven flatten-maven-plugin 是一个比较有意思的项目,核心是对于我们发布的包提供一些简洁清晰的使用,去除掉哪些没用的(比如父pom 信息
,profile 信息。。。)

参考使用

maven flatten-maven-plugin 使用比较简单,就是添加插件,几个简单配置就可以了

 
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>flatten-maven-plugin</artifactId>
    <version>1.3.0</version>
    <executions>
        <execution>
            <phase>process-resources</phase>
            <goals>
                <goal>flatten</goal>
            </goals>
        </execution>
        <execution>
            <id>flatten.clean</id>
            <phase>clean</phase>
            <goals>
                <goal>clean</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <!-- See usage on maven site from link above for details -->
    </configuration>
</plugin>

说明

不少开源项目都会使用此插件,还是比较有用的,有必要在我们的日常项目中引入

参考资料

https://www.mojohaus.org/flatten-maven-plugin/
https://github.com/mojohaus/flatten-maven-plugin

posted on 2023-01-17 23:21  荣锋亮  阅读(1344)  评论(0编辑  收藏  举报

导航