I would like to perform some ant task after the war file being generated.
with following script, if i change the phase to different value like "Install" , it will not prompt error, but i want the ant script run once the war file being generated
When i try to save it with value "compile", it prompt me error "Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-antrun-plugin:1.7:run (execution: default, phase: compile)" in eclipse Juno.
appreciated if anyone can shed some light for this and thanks for your time.
Use the package phase - that is that phase that builds the war file. The antrun:run goal will be run after the war is created.
When you specify in your POM that a goal is to be run in the same phase as a predefined goal, then you goal runs after the predefined goal. If your POM defined multiple goals to be run during a given phase, they will be run in the order in which they appear in the POM, with goal in the parent POM having precedence over your.
Also, there are several phases between "package" and "install", you could always use one of those. (You do have a list of the phases hanging up in your office right next to the monitor, right? Or at least a bookmark to pull up the phases quickly.)