Maven 2 centralizes build flow control thru its lifecycle which has hooking
points for you to intercept

http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html

For your case, you want bind your goals to pre package and the post main
package
which are  test phase and package phase respectively.

Note the war mojo is already bound to package phase, so it will be run first
in that phase.

-Dan


On 5/5/06, Vihung Marathe <[EMAIL PROTECTED]> wrote:

What is the architecturally sound recommended way to migrate a simple
Jelly script (preGoal/postGoal) for Maven 1 into a plugin for Maven 2?

We have a simple jelly script defined in our maven.xml with pre- and
post- goals defined for the 'war:war-resources' goal which does things
like copy some files from another directory to the WEB-INF before
packaging up the webapp and war.

We are looking to move to Maven 2, and I see that we will have to write
a plugin instead of these scripts.

While there are many ways to do it (or to hack it), I was wondering what
the architecturally sound, or recommended aproach, should be.

Basically, what I would like to do is to execute some of my custom code
just before a webapp is assembled, and I do not really care how I do it
- Java, ANT, Jelly, or anything else

i.e. when I issue an 'mvn package' command on my project (with packaging
'war'), I would like it to run some of my code, and then assemble the
webapp, package the war, and then run some more of my code

(Essentially, this is all that the preGoal/postGoal stuff used to do in
Maven 1)

Will appreciate any suggestions

-- Vihung

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to