maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject [maven-acr-plugin] 28/45: Updated deps, modernized code
Date Wed, 20 Dec 2017 09:26:41 GMT
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-acr-plugin-1.1
in repository https://gitbox.apache.org/repos/asf/maven-acr-plugin.git

commit bab65fd3b8b3c5b61d6eb6726234b0ec54f9ec05
Author: Kristian Rosenvold <krosenvold@apache.org>
AuthorDate: Tue Aug 27 19:57:29 2013 +0000

    Updated deps, modernized code
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-acr-plugin@1517960
13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  8 ++--
 .../java/org/apache/maven/plugin/acr/AcrMojo.java  | 43 +++++++++++-----------
 src/site/site.xml                                  |  5 ++-
 3 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/pom.xml b/pom.xml
index e94106a..74a6812 100644
--- a/pom.xml
+++ b/pom.xml
@@ -92,22 +92,22 @@ under the License.
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-filtering</artifactId>
-      <version>1.0</version>
+      <version>1.1</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-interpolation</artifactId>
-      <version>1.12</version>
+      <version>1.19</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
-      <version>3.0.7</version>
+      <version>3.0.15</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-archiver</artifactId>
-      <version>2.1.2</version>
+      <version>2.4.3</version>
       <exclusions>
         <exclusion>
           <groupId>org.codehaus.plexus</groupId>
diff --git a/src/main/java/org/apache/maven/plugin/acr/AcrMojo.java b/src/main/java/org/apache/maven/plugin/acr/AcrMojo.java
index 3893a99..72a20e8 100644
--- a/src/main/java/org/apache/maven/plugin/acr/AcrMojo.java
+++ b/src/main/java/org/apache/maven/plugin/acr/AcrMojo.java
@@ -20,6 +20,7 @@ package org.apache.maven.plugin.acr;
  */
 
 import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.input.XmlStreamReader;
 import org.apache.maven.archiver.MavenArchiveConfiguration;
 import org.apache.maven.archiver.MavenArchiver;
 import org.apache.maven.artifact.DependencyResolutionRequiredException;
@@ -40,7 +41,6 @@ import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.jar.JarArchiver;
 import org.codehaus.plexus.archiver.jar.ManifestException;
 import org.codehaus.plexus.util.FileUtils;
-import org.apache.commons.io.input.XmlStreamReader;
 
 import java.io.File;
 import java.io.IOException;
@@ -53,8 +53,9 @@ import java.util.List;
  * @author <a href="snicoll@apache.org">Stephane Nicoll</a>
  * @version $Id:
  */
-@Mojo (name = "acr", requiresDependencyResolution = ResolutionScope.RUNTIME, threadSafe =
true,
-       defaultPhase = LifecyclePhase.PACKAGE)
+@SuppressWarnings( { "UnqualifiedStaticUsage", "IfStatementWithNegatedCondition" } )
+@Mojo( name = "acr", requiresDependencyResolution = ResolutionScope.RUNTIME, threadSafe =
true,
+       defaultPhase = LifecyclePhase.PACKAGE )
 public class AcrMojo
     extends AbstractMojo
 {
@@ -62,28 +63,26 @@ public class AcrMojo
     private static final String APP_CLIENT_XML = "META-INF/application-client.xml";
 
     // TODO: will null work instead?
-    private static final String[] DEFAULT_INCLUDES = new String[]{ "**/**" };
-
-    private static final String[] DEFAULT_EXCLUDES = new String[]{ APP_CLIENT_XML };
+    private static final String[] DEFAULT_INCLUDES = { "**/**" };
 
-    private static final String[] EMPTY_STRING_ARRAY = new String[0];
+    private static final String[] DEFAULT_EXCLUDES = { APP_CLIENT_XML };
 
     /**
      * The directory for the generated jar.
      */
-    @Parameter (defaultValue = "${project.build.directory}", required = true, readonly =
true)
+    @Parameter( defaultValue = "${project.build.directory}", required = true, readonly =
true )
     private File basedir;
 
     /**
      * Directory that resources are copied to during the build.
      */
-    @Parameter (property = "outputDirectory", defaultValue = "${project.build.outputDirectory}")
+    @Parameter( property = "outputDirectory", defaultValue = "${project.build.outputDirectory}"
)
     private File outputDirectory;
 
     /**
      * The name of the Application client JAR file to generate.
      */
-    @Parameter (property = "jarName", defaultValue = "${project.build.finalName}")
+    @Parameter( property = "jarName", defaultValue = "${project.build.finalName}" )
     private String jarName;
 
     /**
@@ -108,7 +107,7 @@ public class AcrMojo
     /**
      * The Jar archiver.
      */
-    @Component (role = Archiver.class, hint = "jar")
+    @Component( role = Archiver.class, hint = "jar" )
     private JarArchiver jarArchiver;
 
     /**
@@ -122,20 +121,20 @@ public class AcrMojo
      * To escape interpolated value with windows path.
      * c:\foo\bar will be replaced with c:\\foo\\bar.
      */
-    @Parameter (property = "acr.escapeBackslashesInFilePath", defaultValue = "false")
+    @Parameter( property = "acr.escapeBackslashesInFilePath", defaultValue = "false" )
     private boolean escapeBackslashesInFilePath;
 
     /**
      * An expression preceded with this String won't be interpolated.
      * \${foo} will be replaced with ${foo}.
      */
-    @Parameter (property = "acr.escapeString")
+    @Parameter( property = "acr.escapeString" )
     protected String escapeString;
 
     /**
      * To filter the deployment descriptor.
      */
-    @Parameter (property = "acr.filterDeploymentDescriptor", defaultValue = "false")
+    @Parameter( property = "acr.filterDeploymentDescriptor", defaultValue = "false" )
     private boolean filterDeploymentDescriptor;
 
     /**
@@ -146,7 +145,7 @@ public class AcrMojo
 
     /**
      */
-    @Component (role = MavenFileFilter.class, hint = "default")
+    @Component( role = MavenFileFilter.class, hint = "default" )
     private MavenFileFilter mavenFileFilter;
 
     /**
@@ -183,17 +182,17 @@ public class AcrMojo
             if ( excludes != null && !excludes.isEmpty() )
             {
                 excludes.add( APP_CLIENT_XML );
-                mainJarExcludes = excludes.toArray(new String[excludes.size()]);
+                mainJarExcludes = excludes.toArray( new String[excludes.size()] );
             }
 
-            if ( !outputDirectory.exists() )
+            if ( outputDirectory.exists() )
             {
-                getLog().info(
-                    "JAR will only contain the META-INF/application-client.xml as no content
was marked for inclusion" );
+                archiver.getArchiver().addDirectory( outputDirectory, DEFAULT_INCLUDES, mainJarExcludes
);
             }
             else
             {
-                archiver.getArchiver().addDirectory( outputDirectory, DEFAULT_INCLUDES, mainJarExcludes
);
+                getLog().info(
+                    "JAR will only contain the META-INF/application-client.xml as no content
was marked for inclusion" );
             }
 
             if ( deploymentDescriptor.exists() )
@@ -203,7 +202,7 @@ public class AcrMojo
                     getLog().debug( "Filtering deployment descriptor." );
                     MavenResourcesExecution mavenResourcesExecution = new MavenResourcesExecution();
                     mavenResourcesExecution.setEscapeString( escapeString );
-                    List filterWrappers =
+                    List<org.codehaus.plexus.util.FileUtils.FilterWrapper> filterWrappers
=
                         mavenFileFilter.getDefaultFilterWrappers( project, filters, escapeBackslashesInFilePath,
                                                                   this.session, mavenResourcesExecution
);
 
@@ -219,7 +218,7 @@ public class AcrMojo
             }
 
             // create archive
-            archiver.createArchive( project, archive );
+            archiver.createArchive( session, project, archive );
         }
         catch ( ArchiverException e )
         {
diff --git a/src/site/site.xml b/src/site/site.xml
index b35f318..d39f42d 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -19,7 +19,8 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-<project xmlns="http://maven.apache.org/DECORATION/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
+<project xmlns="http://maven.apache.org/DECORATION/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
   <body>
     <menu name="Overview">
       <item name="Introduction" href="index.html"/>
@@ -28,7 +29,7 @@ under the License.
       <item name="FAQ" href="faq.html"/>
     </menu>
     <menu name="Examples">
-      <item name="Filter the deployment descriptor" href="examples/filter-deployment-descriptor.html"
/>
+      <item name="Filter the deployment descriptor" href="examples/filter-deployment-descriptor.html"/>
       <item name="Using the app-client as a dependency" href="examples/app-client-dependency.html"/>
     </menu>
   </body>

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <commits@maven.apache.org>.

Mime
View raw message