I’m using the maven cargo plugin to remotely deploy a servlet in tomcat. When I make updates to the code I have to run two mojos, one for compiling a new war (package), and one for deploying the war remotely (cargo:deployer-redeploy).
I want to be able to simply invoke cargo:deployer-redeploy and it invokes the compilation of the source code and creation of a new war and deploys that remotely. Essentially I want the redeploy mojo to be dependant on the package mojo (in ant terminology).
You can just bind the cargo plugin to a later phase than
package(e.g.verify), so in the plugin’s configuration section in the pom, put something like:When you run
mvn verifyit will run the war plugin (as part ofpackage) then cargo.