You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2016/01/30 21:27:40 UTC

svn commit: r1727754 - in /maven/plugins/trunk/maven-war-plugin/src: main/java/org/apache/maven/plugin/war/ test/java/org/apache/maven/plugin/war/

Author: khmarbaise
Date: Sat Jan 30 20:27:40 2016
New Revision: 1727754

URL: http://svn.apache.org/viewvc?rev=1727754&view=rev
Log:
- Cleaned up Code
  o Removed unused SuppressWarnings
  o Removed calling deprecated code.

Modified:
    maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java
    maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/AbstractWarMojoTest.java
    maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoFilteringTest.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=1727754&r1=1727753&r2=1727754&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 Sat Jan 30 20:27:40 2016
@@ -436,7 +436,6 @@ public abstract class AbstractWarMojo
      * @throws MojoFailureException if an unexpected error occurred while packaging the webapp
      * @throws IOException if an error occurred while copying the files
      */
-    @SuppressWarnings( "unchecked" )
     public void buildWebapp( MavenProject mavenProject, File webapplicationDirectory )
         throws MojoExecutionException, MojoFailureException, IOException
     {

Modified: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/AbstractWarMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/AbstractWarMojoTest.java?rev=1727754&r1=1727753&r2=1727754&view=diff
==============================================================================
--- maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/AbstractWarMojoTest.java (original)
+++ maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/AbstractWarMojoTest.java Sat Jan 30 20:27:40 2016
@@ -19,20 +19,24 @@ package org.apache.maven.plugin.war;
  * under the License.
  */
 
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.maven.execution.DefaultMavenExecutionRequest;
+import org.apache.maven.execution.MavenExecutionRequest;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.testing.AbstractMojoTestCase;
 import org.apache.maven.plugin.testing.stubs.ArtifactStub;
 import org.apache.maven.plugin.war.stub.MavenProjectBasicStub;
 import org.apache.maven.plugin.war.stub.WarOverlayStub;
 import org.apache.maven.shared.filtering.MavenFileFilter;
+import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.archiver.Archiver;
 import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.jar.JarArchiver;
 import org.codehaus.plexus.util.FileUtils;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
+import org.sonatype.aether.RepositorySystemSession;
 
 public abstract class AbstractWarMojoTest
     extends AbstractMojoTestCase
@@ -60,14 +64,18 @@ public abstract class AbstractWarMojoTes
      */
     protected void configureMojo( AbstractWarMojo mojo, List<String> filters, File classesDir, File webAppSource,
                                   File webAppDir, MavenProjectBasicStub project )
-        throws Exception
+                                      throws Exception
     {
         setVariableValueToObject( mojo, "filters", filters );
         setVariableValueToObject( mojo, "useCache", Boolean.FALSE );
         setVariableValueToObject( mojo, "mavenFileFilter", lookup( MavenFileFilter.class.getName() ) );
         setVariableValueToObject( mojo, "useJvmChmod", Boolean.TRUE );
+
+        MavenExecutionRequest request = new DefaultMavenExecutionRequest();
+        request.setSystemProperties( System.getProperties() );
+
         MavenSession mavenSession =
-            new MavenSession( null, null, null, null, null, null, null, System.getProperties(), null );
+            new MavenSession( (PlexusContainer) null, (RepositorySystemSession) null, request, null );
         setVariableValueToObject( mojo, "session", mavenSession );
         mojo.setClassesDirectory( classesDir );
         mojo.setWarSourceDirectory( webAppSource );
@@ -248,10 +256,9 @@ public abstract class AbstractWarMojoTes
         // Archive was not yet created for that id so let's create it
         final File rootDir = new File( OVERLAYS_ROOT_DIR, id );
         rootDir.mkdirs();
-        String[] filePaths =
-            new String[] { "jsp/d/a.jsp", "jsp/d/b.jsp", "jsp/d/c.jsp", "jsp/a.jsp", "jsp/b.jsp", "jsp/c.jsp",
-                "WEB-INF/classes/a.class", "WEB-INF/classes/b.class", "WEB-INF/classes/c.class", "WEB-INF/lib/a.jar",
-                "WEB-INF/lib/b.jar", "WEB-INF/lib/c.jar", "WEB-INF/web.xml" };
+        String[] filePaths = new String[] { "jsp/d/a.jsp", "jsp/d/b.jsp", "jsp/d/c.jsp", "jsp/a.jsp", "jsp/b.jsp",
+            "jsp/c.jsp", "WEB-INF/classes/a.class", "WEB-INF/classes/b.class", "WEB-INF/classes/c.class",
+            "WEB-INF/lib/a.jar", "WEB-INF/lib/b.jar", "WEB-INF/lib/c.jar", "WEB-INF/web.xml" };
 
         for ( String filePath : filePaths )
         {

Modified: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoFilteringTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoFilteringTest.java?rev=1727754&r1=1727753&r2=1727754&view=diff
==============================================================================
--- maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoFilteringTest.java (original)
+++ maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoFilteringTest.java Sat Jan 30 20:27:40 2016
@@ -135,6 +135,7 @@ public class WarExplodedMojoFilteringTes
 
         // update property, and generate again
         System.setProperty( "system.property", "new-system-property-value" );
+        this.configureMojo( mojo, filterList, classesDir, webAppSource, webAppDirectory, project );
 
         mojo.execute();