You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by san84 <Sa...@ge.com> on 2008/02/21 13:38:22 UTC

how to define a goal which wil depends on other goal in maven?

hi all,
how can i define a goal which depends on other goal in my maven.xml
in ant we can do it as follow like 

............
............
blabla
...................
<target name="a" depends ="b"> 

............
............
blabla
...................
please let me know 


-- 
View this message in context: http://www.nabble.com/how-to-define-a-goal-which-wil-depends-on-other-goal-in-maven--tp15610275s177p15610275.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: how to define a goal which wil depends on other goal in maven?

Posted by "simon.kitching@chello.at" <si...@chello.at>.
Firstly, when someone replies in "bottom posting" style, ie with text
beneath the original then do not reply with your text at the top. This
makes the email very hard to read - and is just rude.

I will put my reply at top here because it is now the "least bad" solution..

In maven, compiling always runs before jar. To be precise, the compile
plugin (maven-compile-plugin) is attached to an earlier phase  than the
jar plugin (maven-jar-plugin). So there is nothing to do here; maven has
this already set up.

When you run maven, you just tell it what phase you want to run, eg
   mvn compile (runs all phases up to the compile phase)
or
  mvn test (runs all phases up to the test phase)
or
  mvn package (runs all phases up to the package phase)


Please read the "introduction to maven" pages on the maven website.

Regards,
Simon

san84 schrieb:
> consider  ,
> <target name="jar" depends="compile">
> how can we achieve the same  using maven.
> wil u please explain with examples
> plz
>
>
> simon.kitching@chello.at wrote:
>   
>> san84 schrieb:
>>     
>>> hi all,
>>> how can i define a goal which depends on other goal in my maven.xml
>>> in ant we can do it as follow like 
>>>
>>> ............
>>> ............
>>> blabla
>>> ...................
>>> <target name="a" depends ="b"> 
>>>
>>> ............
>>> ............
>>> blabla
>>> ...................
>>> please let me know 
>>>
>>>
>>>   
>>>       
>> What is the actual problem you are trying to solve? In other words, what
>> do "a" and "b" do, and why does b need to run first?
>>
>> Maven has this concept of "phases" that it runs through in order, with
>> zero or more plugins attached to each phase. So to do something before
>> some other thing, the plugins are bound to the appropriate phases. But
>> the stuff which is set up by default covers almost all cases already...
>>
>> Regards, Simon
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>>     
>
>   


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


Re: how to define a goal which wil depends on other goal in maven?

Posted by san84 <Sa...@ge.com>.
consider  ,
<target name="jar" depends="compile">
how can we achieve the same  using maven.
wil u please explain with examples
plz


simon.kitching@chello.at wrote:
> 
> san84 schrieb:
>> hi all,
>> how can i define a goal which depends on other goal in my maven.xml
>> in ant we can do it as follow like 
>>
>> ............
>> ............
>> blabla
>> ...................
>> <target name="a" depends ="b"> 
>>
>> ............
>> ............
>> blabla
>> ...................
>> please let me know 
>>
>>
>>   
> What is the actual problem you are trying to solve? In other words, what
> do "a" and "b" do, and why does b need to run first?
> 
> Maven has this concept of "phases" that it runs through in order, with
> zero or more plugins attached to each phase. So to do something before
> some other thing, the plugins are bound to the appropriate phases. But
> the stuff which is set up by default covers almost all cases already...
> 
> Regards, Simon
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/how-to-define-a-goal-which-wil-depends-on-other-goal-in-maven--tp15610275s177p15611171.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: how to define a goal which wil depends on other goal in maven?

Posted by VUB Stefan Seidel <ss...@vub.de>.
Your question is not precise enough. I suggest you read
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
and have a look at
http://cvs.peopleware.be/training/maven/maven2/buildLifecyclePhases.html

regards,

Stefan

san84 wrote:
> thank u but how can i do using maven 2?
> 
> plz let me know with ex
> 
> 
> 
> simon.kitching@chello.at wrote:
>> san84 schrieb:
>>> hi all,
>>> how can i define a goal which depends on other goal in my maven.xml
>>> in ant we can do it as follow like 
>>>
>>> ............
>>> ............
>>> blabla
>>> ...................
>>> <target name="a" depends ="b"> 
>>>
>>> ............
>>> ............
>>> blabla
>>> ...................
>>> please let me know 
>>>
>>>
>>>   
>> What is the actual problem you are trying to solve? In other words, what
>> do "a" and "b" do, and why does b need to run first?
>>
>> Maven has this concept of "phases" that it runs through in order, with
>> zero or more plugins attached to each phase. So to do something before
>> some other thing, the plugins are bound to the appropriate phases. But
>> the stuff which is set up by default covers almost all cases already...
>>
>> Regards, Simon
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
> 

-- 
best regards,

Stefan Seidel
software developer
________________________
VUB Printmedia GmbH
Chopinstraße 4
D-04103 Leipzig
Germany
tel.    +49 (341) 9 60 50 07
fax.    +49 (341) 9 60 50 92
mail.   sseidel@vub.de
web.    www.vub.de

HRB Köln 24015
UStID DE 122 649 251
GF Dr. Achim Preuss Neudorf,
Dr. Christian Preuss Neudorf

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


Re: how to define a goal which wil depends on other goal in maven?

Posted by san84 <Sa...@ge.com>.
thank u but how can i do using maven 2?

plz let me know with ex



simon.kitching@chello.at wrote:
> 
> san84 schrieb:
>> hi all,
>> how can i define a goal which depends on other goal in my maven.xml
>> in ant we can do it as follow like 
>>
>> ............
>> ............
>> blabla
>> ...................
>> <target name="a" depends ="b"> 
>>
>> ............
>> ............
>> blabla
>> ...................
>> please let me know 
>>
>>
>>   
> What is the actual problem you are trying to solve? In other words, what
> do "a" and "b" do, and why does b need to run first?
> 
> Maven has this concept of "phases" that it runs through in order, with
> zero or more plugins attached to each phase. So to do something before
> some other thing, the plugins are bound to the appropriate phases. But
> the stuff which is set up by default covers almost all cases already...
> 
> Regards, Simon
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/how-to-define-a-goal-which-wil-depends-on-other-goal-in-maven--tp15610275s177p15612428.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: how to define a goal which wil depends on other goal in maven?

Posted by "simon.kitching@chello.at" <si...@chello.at>.
san84 schrieb:
> hi all,
> how can i define a goal which depends on other goal in my maven.xml
> in ant we can do it as follow like 
>
> ............
> ............
> blabla
> ...................
> <target name="a" depends ="b"> 
>
> ............
> ............
> blabla
> ...................
> please let me know 
>
>
>   
What is the actual problem you are trying to solve? In other words, what
do "a" and "b" do, and why does b need to run first?

Maven has this concept of "phases" that it runs through in order, with
zero or more plugins attached to each phase. So to do something before
some other thing, the plugins are bound to the appropriate phases. But
the stuff which is set up by default covers almost all cases already...

Regards, Simon


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


Re: how to define a goal which wil depends on other goal in maven?

Posted by "simon.kitching@chello.at" <si...@chello.at>.
Ah.. thanks for pointing that out Lukas.

My other reply was about maven 2. Sorry about that.

Maven 2 is **much** better than maven1. Do not use maven 1.x unless you
absolutely have to.

Regards,
Simon

Lukas Theussl schrieb:
> Since you mention maven.xml I assume that you are using maven 1.x. In
> this case, the equivalent of ant's 'depends' is 'prereqs', see eg
> http://maven.apache.org/maven-1.x/reference/scripting.html#Declaring_Goals
>
>
> -Lukas
>
>
> san84 wrote:
>> hi all,
>> how can i define a goal which depends on other goal in my maven.xml
>> in ant we can do it as follow like
>> ............
>> ............
>> blabla
>> ...................
>> <target name="a" depends ="b">
>> ............
>> ............
>> blabla
>> ...................
>> please let me know
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


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


Re: how to define a goal which wil depends on other goal in maven?

Posted by Lukas Theussl <lt...@apache.org>.
Since you mention maven.xml I assume that you are using maven 1.x. In 
this case, the equivalent of ant's 'depends' is 'prereqs', see eg 
http://maven.apache.org/maven-1.x/reference/scripting.html#Declaring_Goals

-Lukas


san84 wrote:
> hi all,
> how can i define a goal which depends on other goal in my maven.xml
> in ant we can do it as follow like 
> 
> ............
> ............
> blabla
> ...................
> <target name="a" depends ="b"> 
> 
> ............
> ............
> blabla
> ...................
> please let me know 
> 
> 


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