问题
Still learning how to use Maven
, and I was wondering if there is a way to do a checksum
on the generated WAR
file.
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.
Thanks in advance!
回答1:
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>
来源:https://stackoverflow.com/questions/25368728/how-do-you-create-a-checksum-in-maven-then-output-it-to-a-text-file