I am using the Maven Checksum Plugin, and I am having problems getting it to execute after the war has been built. Here's my configuration in my superpom under the section:
<build>
...
<pluginManagement>
<plugins>
<plugin>
...
</plugin>
<plugin>
<groupId>net.ju-n.maven.plugins</groupId>
<artifactId>checksum-maven-plugin</artifactId>
<version>1.3-SNAPSHOT</version>
<executions>
<execution>
<id>generate-artifact-checksum</id>
<phase>package</phase>
<goals>
<goal>files</goal>
</goals>
</execution>
</executions>
<configuration>
<fileSets>
<fileSet>
<directory>${project.build.directory}/artifacts</directory>
</fileSet>
</fileSets>
</configuration>
</plugin>
<plugin>
...
</plugin>
</plugins>
</pluginManagement>
</build>
When I run mvn package
, the plugin isn't executed. Not there's an error, but just doesn't execute. Nothing is printed out during the build process. The war is processed, the build is declared successful, and the plugin doesn't execute.
I've tried removing the <phase>
entities and run mvn verify
because according to the documentation on the plugin, the checksum:files
goal is automatically bound to the verify
phase. Still no execution.
However, the plugin does work if I run:
$ mvn checksum:files
What am I missing in my configuration?
The plugin is not executed because it is declared under the pluginManagement
section of your pom
.
You should move the configuration of checksum-maven-plugin
outside pluginManagement
like this:
<build>
<plugins>
<plugin>
...
</plugin>
<plugin>
<groupId>net.ju-n.maven.plugins</groupId>
<artifactId>checksum-maven-plugin</artifactId>
<version>1.3-SNAPSHOT</version>
<executions>
<execution>
<id>generate-artifact-checksum</id>
<phase>package</phase>
<goals>
<goal>files</goal>
</goals>
</execution>
</executions>
<configuration>
<fileSets>
<fileSet>
<directory>${project.build.directory}/artifacts</directory>
</fileSet>
</fileSets>
</configuration>
</plugin>
<plugin>
...
</plugin>
</plugins>
</build>
Refer to this question for a description of pluginManagement
section.