maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r417638 - in /maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war: AbstractWarMojo.java WarExplodedMojo.java WarInPlaceMojo.java WarMojo.java
Date Wed, 28 Jun 2006 02:13:49 GMT
Author: brett
Date: Tue Jun 27 19:13:48 2006
New Revision: 417638

URL: http://svn.apache.org/viewvc?rev=417638&view=rev
Log:
[MWAR-52] fix error reporting when webXml is missing

Modified:
    maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java
    maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarExplodedMojo.java
    maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarInPlaceMojo.java
    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/AbstractWarMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java?rev=417638&r1=417637&r2=417638&view=diff
==============================================================================
--- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java
(original)
+++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java
Tue Jun 27 19:13:48 2006
@@ -23,6 +23,7 @@
 import org.apache.maven.model.Resource;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.UnArchiver;
@@ -330,7 +331,7 @@
     }
 
     public void buildExplodedWebapp( File webappDirectory )
-        throws MojoExecutionException
+        throws MojoExecutionException, MojoFailureException
     {
         getLog().info( "Exploding webapp..." );
 
@@ -359,6 +360,11 @@
 
             if ( webXml != null && StringUtils.isNotEmpty( webXml.getName() ) )
             {
+                if ( !webXml.exists() )
+                {
+                    throw new MojoFailureException( "The specified web.xml file '" + webXml
+ "' does not exist" );
+                }
+
                 //rename to web.xml
                 copyFileIfModified( webXml, new File( webinfDir, "/web.xml" ) );
             }

Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarExplodedMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarExplodedMojo.java?rev=417638&r1=417637&r2=417638&view=diff
==============================================================================
--- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarExplodedMojo.java
(original)
+++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarExplodedMojo.java
Tue Jun 27 19:13:48 2006
@@ -17,6 +17,7 @@
  */
 
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
 
 /**
  * Generate the exploded webapp
@@ -28,7 +29,8 @@
 public class WarExplodedMojo
     extends AbstractWarMojo
 {
-    public void execute() throws MojoExecutionException
+    public void execute()
+        throws MojoExecutionException, MojoFailureException
     {
         buildExplodedWebapp( getWebappDirectory() );
     }

Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarInPlaceMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarInPlaceMojo.java?rev=417638&r1=417637&r2=417638&view=diff
==============================================================================
--- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarInPlaceMojo.java
(original)
+++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarInPlaceMojo.java
Tue Jun 27 19:13:48 2006
@@ -17,6 +17,7 @@
  */
 
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
 
 /**
  * Generates webapp in the source directory
@@ -27,7 +28,8 @@
 public class WarInPlaceMojo
     extends AbstractWarMojo
 {
-    public void execute() throws MojoExecutionException
+    public void execute()
+        throws MojoExecutionException, MojoFailureException
     {
         getLog().info( "Generating webapp in source directory... " + getWarSourceDirectory()
);
 

Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java?rev=417638&r1=417637&r2=417638&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
Tue Jun 27 19:13:48 2006
@@ -20,6 +20,7 @@
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.DependencyResolutionRequiredException;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.project.MavenProjectHelper;
 import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.jar.ManifestException;
@@ -117,7 +118,7 @@
      * @throws MojoExecutionException if an error occured while building the webapp
      */
     public void execute()
-        throws MojoExecutionException
+        throws MojoExecutionException, MojoFailureException
     {
         File warFile = getWarFile( new File( outputDirectory ), warName, classifier );
 
@@ -155,7 +156,7 @@
      */
     private void performPackaging( File warFile )
         throws IOException, ArchiverException, ManifestException, DependencyResolutionRequiredException,
-        MojoExecutionException
+        MojoExecutionException, MojoFailureException
     {
         buildExplodedWebapp( getWebappDirectory() );
 



Mime
View raw message