using preGoal and postGoal in m2?

View: New views
4 Messages — Rating Filter:   Alert me  

using preGoal and postGoal in m2?

by Brill Pappin-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry if this has been covered on the list before (a quick search didn't
turn up anything useful).

Since the maven.xml file is now gone, how to I set up pre/post goals in M2?

They are one of the really good features of maven 1.x and I'll really miss
them if I can't use them.

- Brill Pappin

Re: using preGoal and postGoal in m2?

by John Casey-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The general pattern we've adopted with Maven 2.0 is that of binding your
custom behavior to the appropriate place in an absolute lifecycle,
rather than relative to some other plugin's execution. The problem with
specifying a pre/postGoal is that the referenced goal is the only one
that can ever trigger that custom behavior (ties the build to a concrete
goal, rather than an abstract action), and it's impossible to inject new
behavior between the two (goal and decorator).

In m2, you should be able to determine in which lifecycle phase the mojo
in question executes, and bind your custom plugin to the phase before or
after it.

I know this will probably bring up more questions than it answers, but
I'll let you chew on that for a minute and see what other questions you
have, rather than delving into all the ins and outs of lifecycle binding...

HTH,

john

Brill Pappin wrote:
| Sorry if this has been covered on the list before (a quick search didn't
| turn up anything useful).
|
| Since the maven.xml file is now gone, how to I set up pre/post goals
in M2?
|
| They are one of the really good features of maven 1.x and I'll really miss
| them if I can't use them.
|
| - Brill Pappin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFDVQ1VK3h2CZwO/4URAvVtAKCfO/BU0KCtRugnkH3/fC06aGB2lgCfVLcR
RAqSwJRR1ux7/X2Mlb1z338=
=V6sL
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: using preGoal and postGoal in m2?

by Brett Porter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Or, just point at the docs:

http://maven.apache.org/maven2/lifecycle.html

On 10/18/05, John Casey <jdcasey@...> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> The general pattern we've adopted with Maven 2.0 is that of binding your
> custom behavior to the appropriate place in an absolute lifecycle,
> rather than relative to some other plugin's execution. The problem with
> specifying a pre/postGoal is that the referenced goal is the only one
> that can ever trigger that custom behavior (ties the build to a concrete
> goal, rather than an abstract action), and it's impossible to inject new
> behavior between the two (goal and decorator).
>
> In m2, you should be able to determine in which lifecycle phase the mojo
> in question executes, and bind your custom plugin to the phase before or
> after it.
>
> I know this will probably bring up more questions than it answers, but
> I'll let you chew on that for a minute and see what other questions you
> have, rather than delving into all the ins and outs of lifecycle binding...
>
> HTH,
>
> john
>
> Brill Pappin wrote:
> | Sorry if this has been covered on the list before (a quick search didn't
> | turn up anything useful).
> |
> | Since the maven.xml file is now gone, how to I set up pre/post goals
> in M2?
> |
> | They are one of the really good features of maven 1.x and I'll really miss
> | them if I can't use them.
> |
> | - Brill Pappin
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.6 (GNU/Linux)
>
> iD8DBQFDVQ1VK3h2CZwO/4URAvVtAKCfO/BU0KCtRugnkH3/fC06aGB2lgCfVLcR
> RAqSwJRR1ux7/X2Mlb1z338=
> =V6sL
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: using preGoal and postGoal in m2?

by Brill Pappin-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I can't say that I've got all that far with m2 yet, however what they used
to be good at was "fixing" behavior of a plugin that didn't quite do what it
should/could or allow you to set up a set of goals to be run with one
command ... now as a rule I think a plugin that doesn't do what it
could/should should be fixed, but the reality of it is that most developers
don't have the luxury of waiting on the plugin developers or the plugin
developers simply don't think it's important.

Another case was where we had a lot of tests of different types that had to
be run at certain times (for instance, a set of unit tests before
integration, and a set of automated acceptance tests). having the pre/post
goals (not to mentions goals at all) made doing that very simple.

For the moment I'll restrict my comments on the issue until I better
understand how m2 should work. I can understand the stated reasons for not
including that feature in m2 and I have yet to get deep enough into it to
understand how to get the same functionality but I must admit I'm a bit
concerned that one of the most powerful features of m1 is now gone.