You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Maven User <ma...@gmail.com> on 2012/03/14 19:08:08 UTC

Skip default execution?

Hi all -

I _swore_ you could do this, but maybe I've overlooked something...

I have a project that has a packaging type of "war".  BUT - we have two
ways we'd like to build - a compressed war (if releaseable) or an exploded
directory (if it's a developer build).

I'm doing this:

.....
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <executions>
                    <execution>
                        <id>war</id>
                        <!-- this is where I'm stuck - seems like no matter
what I do, war is built twice -->
                        <phase>package</phase>
                        <goals>
                            <goal>${war.goal}</goal>
                        </goals>
                        <configuration>

                         <whole mess of overlays here>
.....

If the exploded option is specified, the place where we're actually
combining things is directly in the container's webapp dir.

What happens now is if I leave this phase set to package, I can see the war
plugin called twice:

[INFO] --- maven-war-plugin:2.1.1:war (default-war) @
....
[INFO] --- maven-war-plugin:2.1.1:war (war) @

I want to skip that "default-war" one and just do the "war" one or whatever
eliminates ONE of these steps.

Any suggestions?

Re: Skip default execution?

Posted by Maven User <ma...@gmail.com>.
I _think_ I solved this - but I can't tell if I'm leveraging what may seem
like a bug lol.

I used this:

                <executions>
                    <execution>
                        <id>default-war</id>  <------------------
                        <!-- this is where I'm stuck - seems like no matter
what I do, war is built twice -->
                        <phase>package</phase>
                        <goals>
                            <goal>${war.goal}</goal>
                        </goals>
                <configuration>

Now it only runs once :-)

On Wed, Mar 14, 2012 at 2:08 PM, Maven User <ma...@gmail.com> wrote:

> Hi all -
>
> I _swore_ you could do this, but maybe I've overlooked something...
>
> I have a project that has a packaging type of "war".  BUT - we have two
> ways we'd like to build - a compressed war (if releaseable) or an exploded
> directory (if it's a developer build).
>
> I'm doing this:
>
> .....
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <id>war</id>
>                         <!-- this is where I'm stuck - seems like no
> matter what I do, war is built twice -->
>                         <phase>package</phase>
>                         <goals>
>                             <goal>${war.goal}</goal>
>                         </goals>
>                         <configuration>
>
>                          <whole mess of overlays here>
> .....
>
> If the exploded option is specified, the place where we're actually
> combining things is directly in the container's webapp dir.
>
> What happens now is if I leave this phase set to package, I can see the
> war plugin called twice:
>
> [INFO] --- maven-war-plugin:2.1.1:war (default-war) @
> ....
> [INFO] --- maven-war-plugin:2.1.1:war (war) @
>
> I want to skip that "default-war" one and just do the "war" one or
> whatever eliminates ONE of these steps.
>
> Any suggestions?
>
>

RE: Skip default execution?

Posted by Matt Walsh <mw...@chartwelltechnology.com>.
Try changing the execution id to 'default-war'.

> -----Original Message-----
> From: Maven User [mailto:maven.2.user@gmail.com]
> Sent: Wednesday, March 14, 2012 12:08 PM
> To: Maven Users List
> Subject: Skip default execution?
> 
> Hi all -
> 
> I _swore_ you could do this, but maybe I've overlooked something...
> 
> I have a project that has a packaging type of "war".  BUT - we have
two
> ways we'd like to build - a compressed war (if releaseable) or an
> exploded
> directory (if it's a developer build).
> 
> I'm doing this:
> 
> .....
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <id>war</id>
>                         <!-- this is where I'm stuck - seems like no
> matter
> what I do, war is built twice -->
>                         <phase>package</phase>
>                         <goals>
>                             <goal>${war.goal}</goal>
>                         </goals>
>                         <configuration>
> 
>                          <whole mess of overlays here>
> .....
> 
> If the exploded option is specified, the place where we're actually
> combining things is directly in the container's webapp dir.
> 
> What happens now is if I leave this phase set to package, I can see
the
> war
> plugin called twice:
> 
> [INFO] --- maven-war-plugin:2.1.1:war (default-war) @
> ....
> [INFO] --- maven-war-plugin:2.1.1:war (war) @
> 
> I want to skip that "default-war" one and just do the "war" one or
> whatever
> eliminates ONE of these steps.
> 
> Any suggestions?

______________________________________________________________________
This message, including any attachments, is confidential and contains information intended only for the person(s) named above. Any other distribution, copying or disclosure is strictly prohibited. If you are not the intended recipient or have received this message in error, please notify us immediately by reply email and permanently delete the original transmission from all of your systems and hard drives, including any attachments, without making a copy.

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


Re: Skip default execution?

Posted by Maven User <ma...@gmail.com>.
Thanks everyone - and yes, overriding the default execution id works!



On Wed, Mar 14, 2012 at 2:14 PM, Laird Nelson <lj...@gmail.com> wrote:

> On Wed, Mar 14, 2012 at 2:08 PM, Maven User <ma...@gmail.com>
> wrote:
>
> > I'm doing this:
> > .....
> >            <plugin>
> >                <groupId>org.apache.maven.plugins</groupId>
> >                <artifactId>maven-war-plugin</artifactId>
> >                <executions>
> >                    <execution>
> >                        <id>war</id>
> >
>
> Set the id to default-war and see if that does the trick.
>
> Best,
> Laird
>
> --
> http://about.me/lairdnelson
>

Re: Skip default execution?

Posted by Laird Nelson <lj...@gmail.com>.
On Wed, Mar 14, 2012 at 2:08 PM, Maven User <ma...@gmail.com> wrote:

> I'm doing this:
> .....
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-war-plugin</artifactId>
>                <executions>
>                    <execution>
>                        <id>war</id>
>

Set the id to default-war and see if that does the trick.

Best,
Laird

-- 
http://about.me/lairdnelson