You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Deluigi Marcus <ma...@elca.ch> on 2006/12/07 15:39:15 UTC

User-defined phase

Hi

I want to abuse maven to perform a setup for a testing environment, such
as starting derby, starting a tomcat and deploying a WAR file which is
another project. 

Maven does a fine job in downloading all the required software if
necessary and building the WAR file which it is another project.
Besides, it is platform independent, so I am using it for all these
tasks. 

But I don't want to enter all these commands on the command line all the
time. I think a much nicer way would be to add a custom phase (such as
'start-environment') to the module. When I am developing, I would like
to be able to execute only this phase, without the life-cycle.

Is something like that possible?
Of course, I can make a shell-script but I think adding a custom phase
to the project would be a nice thing.



Greetings
Marcus

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


Re: User-defined phase

Posted by Saloucious <sa...@gmail.com>.
Ok , assume you don't want to bind your goal to a phase.
Have you got a solution to be able to launch several times same goal in a
unique build process ?


franz see wrote:
> 
> Good day to you, Marcus,
> 
> As already mentioned, you cannot create your custom phase ( well,
> technically, you can. but that would require you to create your own
> lifecyle and using that but that is not recommendable, nor is it an easy
> task. But if you really really realy want to, take a look at the clover
> plugin ).
> 
> Furthermore, creating a custom phase will not help you in your endeavor.
> You cannot run a single phase on its own. When you execute a phase, all
> the preceeding phases are executed as well. 
> 
> However, what you are probably looking for is a goal. A goal is a task
> that can be executed on its own. And these goals are usually bound to
> phase to create a custom build. 
> 
> In your case, if your 'start-environment' phase executes only one goal,
> then you can simply call that goal and problem solved.
> 
> But if executes several goals, then you might want to use a profile for
> that and run that profile instead. Haven't tried it myself but im guessing
> that would work.
> 
> Cheers,
> Franz
> 
> 
> Deluigi Marcus wrote:
>> 
>> Hi
>> 
>> I want to abuse maven to perform a setup for a testing environment, such
>> as starting derby, starting a tomcat and deploying a WAR file which is
>> another project. 
>> 
>> Maven does a fine job in downloading all the required software if
>> necessary and building the WAR file which it is another project.
>> Besides, it is platform independent, so I am using it for all these
>> tasks. 
>> 
>> But I don't want to enter all these commands on the command line all the
>> time. I think a much nicer way would be to add a custom phase (such as
>> 'start-environment') to the module. When I am developing, I would like
>> to be able to execute only this phase, without the life-cycle.
>> 
>> Is something like that possible?
>> Of course, I can make a shell-script but I think adding a custom phase
>> to the project would be a nice thing.
>> 
>> 
>> 
>> Greetings
>> Marcus
>> 
>> ---------------------------------------------------------------------
>> 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/User-defined-phase-tf2774745s177.html#a13797887
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: User-defined phase

Posted by franz see <fr...@gmail.com>.
Good day to you, Marcus,

As already mentioned, you cannot create your custom phase ( well,
technically, you can. but that would require you to create your own lifecyle
and using that but that is not recommendable, nor is it an easy task. But if
you really really realy want to, take a look at the clover plugin ).

Furthermore, creating a custom phase will not help you in your endeavor. You
cannot run a single phase on its own. When you execute a phase, all the
preceeding phases are executed as well. 

However, what you are probably looking for is a goal. A goal is a task that
can be executed on its own. And these goals are usually bound to phase to
create a custom build. 

In your case, if your 'start-environment' phase executes only one goal, then
you can simply call that goal and problem solved.

But if executes several goals, then you might want to use a profile for that
and run that profile instead. Haven't tried it myself but im guessing that
would work.

Cheers,
Franz


Deluigi Marcus wrote:
> 
> Hi
> 
> I want to abuse maven to perform a setup for a testing environment, such
> as starting derby, starting a tomcat and deploying a WAR file which is
> another project. 
> 
> Maven does a fine job in downloading all the required software if
> necessary and building the WAR file which it is another project.
> Besides, it is platform independent, so I am using it for all these
> tasks. 
> 
> But I don't want to enter all these commands on the command line all the
> time. I think a much nicer way would be to add a custom phase (such as
> 'start-environment') to the module. When I am developing, I would like
> to be able to execute only this phase, without the life-cycle.
> 
> Is something like that possible?
> Of course, I can make a shell-script but I think adding a custom phase
> to the project would be a nice thing.
> 
> 
> 
> Greetings
> Marcus
> 
> ---------------------------------------------------------------------
> 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/User-defined-phase-tf2774745s177.html#a8073652
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: User-defined phase

Posted by Wayne Fay <wa...@gmail.com>.
I generally abuse Ant for these kinds of things rather than Maven...

Wayne

On 12/7/06, Eric Redmond <er...@gmail.com> wrote:
> The phases are community defined, and there are no plans to ever change
> that. This is why Maven is easy to understand and use wherever you go -
> rather than having to learn a bunch of "custom" stuff. If you really want to
> coallate your work into a single command, try using the "exec"  goal:
> http://mojo.codehaus.org/exec-maven-plugin/
>
> Eric
>
> On 12/7/06, Deluigi Marcus <ma...@elca.ch> wrote:
> >
> > Hi
> >
> > I want to abuse maven to perform a setup for a testing environment, such
> > as starting derby, starting a tomcat and deploying a WAR file which is
> > another project.
> >
> > Maven does a fine job in downloading all the required software if
> > necessary and building the WAR file which it is another project.
> > Besides, it is platform independent, so I am using it for all these
> > tasks.
> >
> > But I don't want to enter all these commands on the command line all the
> > time. I think a much nicer way would be to add a custom phase (such as
> > 'start-environment') to the module. When I am developing, I would like
> > to be able to execute only this phase, without the life-cycle.
> >
> > Is something like that possible?
> > Of course, I can make a shell-script but I think adding a custom phase
> > to the project would be a nice thing.
> >
> >
> >
> > Greetings
> > Marcus
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Eric Redmond
> http://codehaus.org/~eredmond
>
>

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


Re: User-defined phase

Posted by Eric Redmond <er...@gmail.com>.
The phases are community defined, and there are no plans to ever change
that. This is why Maven is easy to understand and use wherever you go -
rather than having to learn a bunch of "custom" stuff. If you really want to
coallate your work into a single command, try using the "exec"  goal:
http://mojo.codehaus.org/exec-maven-plugin/

Eric

On 12/7/06, Deluigi Marcus <ma...@elca.ch> wrote:
>
> Hi
>
> I want to abuse maven to perform a setup for a testing environment, such
> as starting derby, starting a tomcat and deploying a WAR file which is
> another project.
>
> Maven does a fine job in downloading all the required software if
> necessary and building the WAR file which it is another project.
> Besides, it is platform independent, so I am using it for all these
> tasks.
>
> But I don't want to enter all these commands on the command line all the
> time. I think a much nicer way would be to add a custom phase (such as
> 'start-environment') to the module. When I am developing, I would like
> to be able to execute only this phase, without the life-cycle.
>
> Is something like that possible?
> Of course, I can make a shell-script but I think adding a custom phase
> to the project would be a nice thing.
>
>
>
> Greetings
> Marcus
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Eric Redmond
http://codehaus.org/~eredmond