#13Maven打包生成MD5校验文件的两种方式

目录

1、checksum-maven-plugin

2、maven-antrun-plugin


1、checksum-maven-plugin

<plugin>
	<groupId>net.ju-n.maven.plugins</groupId>
    <artifactId>checksum-maven-plugin</artifactId>
    <version>1.2</version>
    <executions>
        <execution>
            <id>checksum-maven-plugin-files</id>
            <phase>package</phase>
            <goals>
                <goal>files</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <fileSets>
            <fileSet>
                <directory>${project.build.directory}</directory>
                <includes>
                    <include>*.war</include>
                </includes>
            </fileSet>
        </fileSets>
        <algorithms>
            <algorithm>MD5</algorithm>
        </algorithms>
    </configuration>
</plugin>

配置已经很清晰,package阶段结束后生成md5文件,但文件后缀为小写的md5。

2、maven-antrun-plugin

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <version>3.0.0</version>
    <executions>
        <execution>
            <id>generate-md5</id>
            <phase>package</phase>
            <goals>
                <goal>run</goal>
            </goals>
            <configuration>
                <target>
                    <checksum algorithm="md5" file="${project.build.directory}/${project.build.finalName}.war" property="md5.checksum"/>
                    <echo file="${project.build.directory}/${project.build.finalName}.war.MD5" message="${md5.checksum}"/>
                </target>
            </configuration>
        </execution>
    </executions>
</plugin>

此插件可以自定义文件后缀名,因此可以生成大写后缀MD5的校验文件。

如果对你有帮助,点赞、收藏、关注是我更新的动力!

往期精彩:

#12解决request中getReader()和getInputStream()只能调用一次的问题-CSDN博客文章浏览阅读2.1k次,点赞64次,收藏30次。getInputStream() has already been called for this request,解决request中getReader()和getInputStream()只能调用一次的问题https://blog.csdn.net/weixin_42718399/article/details/136237084?spm=1001.2014.3001.5501#11vue3中使用el-dialog展示与关闭交由父组件控制的写法_vue dailog 固定关闭按钮-CSDN博客文章浏览阅读1.1k次,点赞40次,收藏28次。vue3中使用elementplus的el-dialog展示与关闭交由父组件控制的写法,分两种方法,使用difineExpose或者defineEmits实现_vue dailog 固定关闭按钮https://blog.csdn.net/weixin_42718399/article/details/136155379?spm=1001.2014.3001.5501#10外部网页跳转vue3+SpringMVC解码GBK编码的参数-CSDN博客文章浏览阅读2.2k次,点赞64次,收藏18次。外部网页跳转vue3页面解码GBK编码的参数问题(包括乱码、解码失败、无法进入页面、URI malformed等问题)https://blog.csdn.net/weixin_42718399/article/details/135995885?spm=1001.2014.3001.5501

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

火鸡nobug

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值