File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven with Ant task Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven with Ant task" Watch "Maven with Ant task" New topic
Author

Maven with Ant task

Nakataa Kokuyo
Ranch Hand

Joined: Jul 24, 2011
Posts: 186
Good day,

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.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

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.)


JBoss In Action
Nakataa Kokuyo
Ranch Hand

Joined: Jul 24, 2011
Posts: 186
Thanks ! package is working fine for this case, appreciated your time and sharing Peter!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Maven with Ant task