You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mike Darretta <mi...@metnet.navy.mil> on 2007/02/16 02:07:42 UTC
Simple antrun question
I know this is a very simple question, but I'm lost on how to solve it.
I want to add an antrun task to my pom.xml that I can execute outside of
any lifecycle phase. In short, I want to run it much like a normal ant goal.
What I currently have is:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>myId</id>
<configuration>
<tasks>
<ant antfile="./build.xml" target="t1"/>
<ant antfile="./build.xml" target="t2"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
I thought that if I execute mvn antrun:run, this would execute the two
listed targets. Instead, I simply get a nice short message stating that
my goals have been executed, but the evidence is to the contrary.
Note that if I do add a phase to this markup, and execute against that
phase, all is well. This is not, though, what I desire to do.
Any help is appreciated.
Regards,
--
Mike Darretta
NIC Web Project Lead
Computer Sciences Corporation (CSC)
(o) 831.656.4324
(c) 209.814.2774
michael.darretta.ctr@metnet.navy.mil
------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit
written agreement or government initiative expressly permitting the use
of e-mail for such purpose.
------------------------------------------------------------
Re: Simple antrun question
Posted by Mike Darretta <mi...@metnet.navy.mil>.
These answer my "unstated" question - does what I'm trying to do make
sense :)? I currently do execute via ant, but thought I could do the
same using maven. Guess I'll scrap the idea and stick with ant.
Thanks for the help.
Mike
Wendy Smoak wrote:
> On 2/15/07, Mike Darretta <mi...@metnet.navy.mil> wrote:
>
>> I know this is a very simple question, but I'm lost on how to solve it.
>>
>> I want to add an antrun task to my pom.xml that I can execute outside of
>> any lifecycle phase. In short, I want to run it much like a normal ant
>> goal.
>
>
> Half of me wants to say, "Then why not just use Ant?" and the other
> half wants to know what you're doing in those tasks. The default
> lifecycle covers most situations, what are you doing that doesn't fit?
>
> In any case, there is no getting around the fact that Maven is
> lifecycle based. Since it does work if you bind to a phase, try doing
> that, and put it in a profile. Then 'mvn antrun:run [phase]
> -Pmyprofile' should work.
>
--
Mike Darretta
NIC Web Project Lead
Computer Sciences Corporation (CSC)
(o) 831.656.4324
(c) 209.814.2774
michael.darretta.ctr@metnet.navy.mil
------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit
written agreement or government initiative expressly permitting the use
of e-mail for such purpose.
------------------------------------------------------------
Re: Simple antrun question
Posted by Wendy Smoak <ws...@gmail.com>.
On 2/15/07, Mike Darretta <mi...@metnet.navy.mil> wrote:
> I know this is a very simple question, but I'm lost on how to solve it.
>
> I want to add an antrun task to my pom.xml that I can execute outside of
> any lifecycle phase. In short, I want to run it much like a normal ant goal.
Half of me wants to say, "Then why not just use Ant?" and the other
half wants to know what you're doing in those tasks. The default
lifecycle covers most situations, what are you doing that doesn't fit?
In any case, there is no getting around the fact that Maven is
lifecycle based. Since it does work if you bind to a phase, try doing
that, and put it in a profile. Then 'mvn antrun:run [phase]
-Pmyprofile' should work.
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Simple antrun question
Posted by Wayne Fay <wa...@gmail.com>.
Any particular reason why you don't just put those in an external
build.xml file and call them directly from Ant, rather than attempting
to make it work by embedding inside your pom.xml etc?
That's how I handle these kinds of situations, personally.
Wayne
On 2/15/07, Mike Darretta <mi...@metnet.navy.mil> wrote:
> I know this is a very simple question, but I'm lost on how to solve it.
>
> I want to add an antrun task to my pom.xml that I can execute outside of
> any lifecycle phase. In short, I want to run it much like a normal ant goal.
>
> What I currently have is:
>
> <plugin>
> <artifactId>maven-antrun-plugin</artifactId>
> <executions>
> <execution>
> <id>myId</id>
> <configuration>
> <tasks>
> <ant antfile="./build.xml" target="t1"/>
> <ant antfile="./build.xml" target="t2"/>
> </tasks>
> </configuration>
> <goals>
> <goal>run</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
>
> I thought that if I execute mvn antrun:run, this would execute the two
> listed targets. Instead, I simply get a nice short message stating that
> my goals have been executed, but the evidence is to the contrary.
>
> Note that if I do add a phase to this markup, and execute against that
> phase, all is well. This is not, though, what I desire to do.
>
> Any help is appreciated.
>
> Regards,
> --
>
> Mike Darretta
> NIC Web Project Lead
> Computer Sciences Corporation (CSC)
> (o) 831.656.4324
> (c) 209.814.2774
> michael.darretta.ctr@metnet.navy.mil
>
> ------------------------------------------------------------
> This is a PRIVATE message. If you are not the intended recipient, please
> delete without copying and kindly advise us by e-mail of the mistake in
> delivery. NOTE: Regardless of content, this e-mail shall not operate to
> bind CSC to any order or other contract unless pursuant to explicit
> written agreement or government initiative expressly permitting the use
> of e-mail for such purpose.
> ------------------------------------------------------------
>
>
>
>
> ---------------------------------------------------------------------
> 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