You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by trant <mm...@webatrocity.com> on 2011/05/10 16:52:36 UTC
How can I have a goal depend on another goal?
I am a newcomer to maven so forgive me if this sounds stupid...
I setup a web application project in MyEclipse, and built a pom.xml that
deploys my war archive to WebLogic.
this works fine, however it is just a standalone piece. For the whole
process, I need to first run maven package to build my war, then I need to
manually ensure my WebLogic server is running or the deploy task will fail
to connect.
How can I make this into one simple execution?
First, it should package my war just like package goal does.
Then immediately afterwards, it should ensure my WebLogic is started and
start it if not (or just run the weblogic:start goal I think I can ignore
the error if it finds the server already started)
Then finally do a deploy to WebLogic.
How can I do this using Maven?
--
View this message in context: http://maven.40175.n5.nabble.com/How-can-I-have-a-goal-depend-on-another-goal-tp4384674p4384674.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 can I have a goal depend on another goal?
Posted by Anders Hammar <an...@hammar.net>.
Cargo does support remote deployment. If you switch to the cargo mailing
list, we'll help you.
/Anders
On Thu, May 12, 2011 at 16:58, trant <mm...@webatrocity.com> wrote:
> Hi John,
>
> Thanks for the reference to Cargo.
>
> It looks like a cool plugin but according to the documentation it falls
> short - it does not seem to support remote deploy- something which I need.
> Only now during initial development am I deploying to local instance of
> WebLogic, however soon when development starts to kick into high gear I'm
> going to be deploying to a remote development server. Then later a remote
> test server. So it would be nice to have this all done by one plugin.
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/How-can-I-have-a-goal-depend-on-another-goal-tp4384674p4390485.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 can I have a goal depend on another goal?
Posted by trant <mm...@webatrocity.com>.
Hi John,
Thanks for the reference to Cargo.
It looks like a cool plugin but according to the documentation it falls
short - it does not seem to support remote deploy- something which I need.
Only now during initial development am I deploying to local instance of
WebLogic, however soon when development starts to kick into high gear I'm
going to be deploying to a remote development server. Then later a remote
test server. So it would be nice to have this all done by one plugin.
--
View this message in context: http://maven.40175.n5.nabble.com/How-can-I-have-a-goal-depend-on-another-goal-tp4384674p4390485.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 can I have a goal depend on another goal?
Posted by John Singleton <jh...@gmail.com>.
Trant,
Look at the cargo plugin (http://cargo.codehaus.org/). It is useful for
starting/stopping J2EE containers and deploying modules to them.
With proper configuration of the plugin (<deployable>, <container> and
<configuration> elements), you just need something like this in your build
section:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>deploy</goal>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
<goal>undeploy</goal>
</goals>
</execution>
</executions>
</plugin>
We use this everyday on our CI machine and it does pretty much what I
understand you need.
On Wed, May 11, 2011 at 3:25 PM, trant <mm...@webatrocity.com> wrote:
> Yep, I didn't understand that concept.
>
> So what I tried now is I added an execution to my plugin, as follows:
>
> <executions>
> <execution>
> <phase>install</phase>
> <goals>
> <goal>deploy</goal>
> </goals>
> </execution>
> </executions>
>
> under the assumption that maven will now consider this plugin as part of
> the
> deploy goal of the install phase?
>
> I tried running it and it actually does do what I want, it now does all the
> steps prior to deploy - build, test, package, etc...
>
> So that's good. Not sure if I did it the right way though or just lucked
> out.
>
> But now what if I also wanted the other goal I mentioned called
> weblogic:start to run prior to this deploy? What would I need to do to the
> pom? I am thinking maybe put that goal in the executions prior to the
> existing deploy goal? like: <goal>weblogic:start</goal> ?? Somehow I dont
> think thats the correct way to do it
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/How-can-I-have-a-goal-depend-on-another-goal-tp4384674p4388271.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 can I have a goal depend on another goal?
Posted by trant <mm...@webatrocity.com>.
Yep, I didn't understand that concept.
So what I tried now is I added an execution to my plugin, as follows:
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
under the assumption that maven will now consider this plugin as part of the
deploy goal of the install phase?
I tried running it and it actually does do what I want, it now does all the
steps prior to deploy - build, test, package, etc...
So that's good. Not sure if I did it the right way though or just lucked
out.
But now what if I also wanted the other goal I mentioned called
weblogic:start to run prior to this deploy? What would I need to do to the
pom? I am thinking maybe put that goal in the executions prior to the
existing deploy goal? like: <goal>weblogic:start</goal> ?? Somehow I dont
think thats the correct way to do it
--
View this message in context: http://maven.40175.n5.nabble.com/How-can-I-have-a-goal-depend-on-another-goal-tp4384674p4388271.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 can I have a goal depend on another goal?
Posted by trant <mm...@webatrocity.com>.
When I say deploy I mean as in deploying my packaged application to my web
application server.
--
View this message in context: http://maven.40175.n5.nabble.com/How-can-I-have-a-goal-depend-on-another-goal-tp4384674p4388273.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 can I have a goal depend on another goal?
Posted by EJ Ciramella <ec...@casenetinc.com>.
FWIW - "deploy" and "install" are generally overused/overloaded terms.
When talking about a "mvn deploy" this implies deploying a project's artifacts to the internal (ie: not local) repository. "mvn install" deploys the same artifacts to the local repository.
Is this truly the desired behavior?
-----Original Message-----
From: Karl Heinz Marbaise [mailto:kama@soebes.de]
Sent: Tuesday, May 10, 2011 11:02 AM
To: users@maven.apache.org
Subject: Re: How can I have a goal depend on another goal?
Hi,
that sounds to me that you didn't know the Maven Life Cycle which runs
always...
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
This means for you that if you call
mvn package
every phase before package will run complete incl. the package phase itself.
Or in other words if you call
mvn deploy
all phases before deploy will run and of course deploy itself as well.
Now you can bound a plugin to a particular phase to do particular
things...for example check if the container runs...
For example via cargo plugin you start different containers etc. but the
cargo plugin is more intended for integration tests instead for
deployment...
Kind regards
Karl Heinz Marbaise
-----
Kind regards
Karl Heinz Marbaise
----
http://www.soebes.de
http://www.skmwiki.de
http://supose.org/wiki/supose
--
View this message in context: http://maven.40175.n5.nabble.com/How-can-I-have-a-goal-depend-on-another-goal-tp4384674p4384704.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
CONFIDENTIALITY NOTICE: This e-mail and the information transmitted within including any attachments is only for the recipient(s) to which it is intended and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of; or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please send the e-mail back by replying to the sender and permanently delete the entire message and its attachments from all computers and network systems involved in its receipt.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: How can I have a goal depend on another goal?
Posted by Karl Heinz Marbaise <ka...@soebes.de>.
Hi,
that sounds to me that you didn't know the Maven Life Cycle which runs
always...
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
This means for you that if you call
mvn package
every phase before package will run complete incl. the package phase itself.
Or in other words if you call
mvn deploy
all phases before deploy will run and of course deploy itself as well.
Now you can bound a plugin to a particular phase to do particular
things...for example check if the container runs...
For example via cargo plugin you start different containers etc. but the
cargo plugin is more intended for integration tests instead for
deployment...
Kind regards
Karl Heinz Marbaise
-----
Kind regards
Karl Heinz Marbaise
----
http://www.soebes.de
http://www.skmwiki.de
http://supose.org/wiki/supose
--
View this message in context: http://maven.40175.n5.nabble.com/How-can-I-have-a-goal-depend-on-another-goal-tp4384674p4384704.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