Ok, let's break down your example.

When you call 'newVersion', these happen (in this order):
    -> ${basedir}/target/classes get deleted
-> it attempts to run 'jar:install' but a preGoal for it has been defined, so maven must execute everything defined in the preGoal first -> the cvs command is executed (this is inside the preGoal definition)
    -> 'jar:install' finally runs

So, in answer to your questions, the preGoal will execute, not before or after the 'newVersion' but inside it, before 'jar:install'.

Regards,
Henry



Zheng Wen Zhe wrote:
Thanks Henry,
But what about there are other goals reside in this maven.xml with Pregoal
together? For instance,

<goal name="newVersion">
    <delete dir="${basedir}/target/classes"/>
    <attainGoal name="jar:install"/>
  </goal>
***
<preGoal name="java:compile">
<cvs command="commit -m 'updated and checked in automatically by maven'"
package="build.number" quiet="true" />
</preGoal>

within the example above, I want to call goal 'newVersion'.Will Pregoal
execute also?If so, before 'newVersion' or after 'newVersion'?

Regards,
Jason



-----Original Message-----
From: Henry Isidro [mailto:[EMAIL PROTECTED]
Sent: 19 January 2006 09:16
To: Maven Users List
Subject: Re: PreGoal ??


preGoal executes the scripts you specify before the goal named. For instance,

<preGoal name="java:compile">
     ...
</preGoal>

Anything between <preGoal> and </preGoal> would execute first and then java:compile would be executed.

Regards,
Henry

Zheng Wen Zhe wrote:


Hi,
I have a pregoal set up among some other goals within my maven.xml file.
Why this pregoal could run automatically without being called?
Is this the nature of PreGoal?

Regards,
Jason

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



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

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


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

Reply via email to