You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Brett Porter <br...@apache.org> on 2006/03/31 01:57:47 UTC

Re: svn commit: r388004 - /maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java

The normal convention for this is to assign a classifier and attach it
instead.

I can see that you might not want to install at all though, so I'll
leave this intact and rename to "primaryArtifact" instead, which I feel
is clearer.

- Brett

aramirez@apache.org wrote:
> Author: aramirez
> Date: Wed Mar 22 18:34:15 2006
> New Revision: 388004
> 
> URL: http://svn.apache.org/viewcvs?rev=388004&view=rev
> Log:
> PR: MWAR-13
> Submitted By: Maria Odea Ching
> Reviewed By: Allan Ramirez
> 
> allows turning off the setting of the war file generated in the executions section, which will be used by install and deploy as reference for the artifact to be copied to the repository.
> 
> Modified:
>     maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java
> 
> Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java
> URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java?rev=388004&r1=388003&r2=388004&view=diff
> ==============================================================================
> --- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java (original)
> +++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java Wed Mar 22 18:34:15 2006
> @@ -83,6 +83,11 @@
>       */
>      private MavenProjectHelper projectHelper;
>  
> +    /**
> +     * @parameter expression="${setWarFile}" default-value="true"
> +     */
> +    private boolean setWarFile;
> +
>      // ----------------------------------------------------------------------
>      // Implementation
>      // ----------------------------------------------------------------------
> @@ -168,7 +173,17 @@
>          }
>          else
>          {
> -            getProject().getArtifact().setFile( warFile );
> +            if( setWarFile )
> +            {
> +                getProject().getArtifact().setFile( warFile );
> +            }
> +            else
> +            {
> +                if( getProject().getArtifact().getFile() == null || getProject().getArtifact().getFile().isDirectory() )
> +                {
> +                    getProject().getArtifact().setFile( warFile );
> +                }
> +            }            
>          }
>      }
>  }
> 
> 

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