Last time I successfully added a nice checksum-maven-plugin
in maven. I generate the checksum for one of my file. I am using for that this special configuration:
<execution>
<phase>package</phase>
<goals>
<goal>files</goal>
</goals>
</execution>
...
<fileSets>
<fileSet>
<directory>${basedir}/myfiles</directory>
<includes>
<include>file-name</include>
</includes>
</fileSet>
</fileSets>
It works perfect and generates a file-name.md5
file with checksum inside /target
.
I build my JAR with maven-assembly-plugin
with this execution.
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
Inside Java I have already access to my src/main/resources/my.properties
properties file with:
InputStream inputStream = RunJetty.class.getClassLoader()
.getResourceAsStream("my.properties");
(this works OK).
I need the checksum generated by checksum-maven-plugin
pass to Java code. How to do that?
After some comments I see two options:
- One is to add the checksum file to JAR.
- 2'nd is to add the checksum value to
my.properties
file (or create separate properties file).