how to generate a checksum for a war file in maven

2.7k views Asked by At

I have inherited a project which uses a maven pom file to build the .war file and we have a request to generate a checksum of the .war file, so my question is, can this be done in the maven pom file? and what plugin if any is needed and how to configure it?

we use the maven-war-plugin for building

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
           <version>2.5</version>
            <configuration>
                <webResources>
                    <resource>
                        <directory>target/minifiedOutput</directory>
                    </resource>
                </webResources>
            </configuration>
        </plugin>

is it possible to use the maven-install-plugin to generate a checksum of the output war file, searching around the subject it seems to provide checksum functionality but it isn't clear to me how to integrate it with the existing pom file?

1

There are 1 answers

0
Ashoka On BEST ANSWER

Use the Maven install plugin :https://maven.apache.org/plugins/maven-install-plugin/plugin-info.html , set the property in the configuration: createChecksum to true. This is a common practice.

There's also other plugins : http://nicoulaj.github.io/checksum-maven-plugin/