如何在Maven中创建校验和然后将其输出到文本文件? [英] How do you create a checksum in Maven then output it to a text file?
本文介绍了如何在Maven中创建校验和然后将其输出到文本文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
还在学习如何使用 Maven
,我想知道是否有办法在校验和
上进行生成的 WAR
文件。
Still learning how to use Maven
, and I was wondering if there is a way to do a checksum
on the generated WAR
file.
Maven
的目标是 package
,以及我的内容我想要实现的是将一个校验和
值(打包的 WAR
文件)放入一个文本文件旁边打包文件。
The Maven
goal is package
, and what I'm trying to achieve is to get a checksum
value (of the packaged WAR
file) put into a text file alongside the packaged file.
提前致谢!
推荐答案
使用以下工具 pom
代码并将我的 Maven
目标更改为验证
Got it working with the below pom
code and changing my Maven
goal to verify
<dependency>
...
<!-- CheckSum -->
<dependency>
<groupId>net.ju-n.maven.plugins</groupId>
<artifactId>checksum-maven-plugin</artifactId>
<version>1.2</version>
<exclusions>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.51</version>
</dependency>
</dependencies>
<plugins>
...
<plugin>
<groupId>net.ju-n.maven.plugins</groupId>
<artifactId>checksum-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<goals>
<goal>artifacts</goal>
</goals>
</execution>
</executions>
<configuration>
<fileSets>
<fileSet>
<includes>
<include>**/*.war</include>
</includes>
</fileSet>
</fileSets>
<csvSummary>true</csvSummary>
<csvSummaryFile>IRIDDS-checksums.csv</csvSummaryFile>
</configuration>
<dependencies>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.51</version>
</dependency>
</dependencies>
</plugin>
</plugins>
这篇关于如何在Maven中创建校验和然后将其输出到文本文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文