You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by br...@apache.org on 2005/09/29 04:04:37 UTC

svn commit: r292374 - /maven/components/trunk/maven-plugins/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AssemblyMojo.java

Author: brett
Date: Wed Sep 28 19:04:34 2005
New Revision: 292374

URL: http://svn.apache.org/viewcvs?rev=292374&view=rev
Log:
include META-INF, just make sure files in resources take precedence

Modified:
    maven/components/trunk/maven-plugins/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AssemblyMojo.java

Modified: maven/components/trunk/maven-plugins/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AssemblyMojo.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AssemblyMojo.java?rev=292374&r1=292373&r2=292374&view=diff
==============================================================================
--- maven/components/trunk/maven-plugins/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AssemblyMojo.java (original)
+++ maven/components/trunk/maven-plugins/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AssemblyMojo.java Wed Sep 28 19:04:34 2005
@@ -142,13 +142,11 @@
 
     /**
      * Create the binary distribution.
-     *
-     * @throws ArchiverException, IOException, MojoExecutionException, XmlPullParserException
      */
     private void doExecute()
         throws ArchiverException, IOException, MojoExecutionException, XmlPullParserException
     {
-        Reader r = null;
+        Reader r;
 
         if ( descriptor != null )
         {
@@ -189,8 +187,8 @@
                 // TODO: use component roles? Can we do that in a mojo?
                 Archiver archiver = createArchiver( format );
 
-                processFileSets( archiver, assembly.getFileSets(), assembly.isIncludeBaseDirectory() );
                 processDependencySets( archiver, assembly.getDependencySets(), assembly.isIncludeBaseDirectory() );
+                processFileSets( archiver, assembly.getFileSets(), assembly.isIncludeBaseDirectory() );
 
                 File destFile = new File( outputDirectory, filename );
                 archiver.setDestFile( destFile );
@@ -211,7 +209,6 @@
      * @param archiver
      * @param dependencySets
      * @param includeBaseDirectory
-     * @throws ArchiverException, IOException, MojoExecutionException
      */
     private void processDependencySets( Archiver archiver, List dependencySets, boolean includeBaseDirectory )
         throws ArchiverException, IOException, MojoExecutionException
@@ -273,7 +270,7 @@
                             unpack( artifact.getFile(), tempLocation );
                         }
                         archiver.addDirectory( tempLocation, null,
-                                               (String[]) getJarExcludes().toArray( EMPTY_STRING_ARRAY ) );
+                                               (String[]) getDefaultExcludes().toArray( EMPTY_STRING_ARRAY ) );
                     }
                     else
                     {
@@ -376,7 +373,8 @@
         Pattern pat = Pattern.compile( "^(.*)\\$\\{([^\\}]+)\\}(.*)$" );
         Matcher mat = pat.matcher( expression );
 
-        String left, right;
+        String left;
+        String right;
         Object middle;
 
         if ( mat.matches() )
@@ -396,7 +394,7 @@
             {
                 // TODO: There should be a more generic way dealing with that. Having magic words is not good at all.
                 // probe for magic word
-                if ( mat.group( 2 ).trim().equals( "extension" ) )
+                if ( "extension".equals( mat.group( 2 ).trim() ) )
                 {
                     ArtifactHandler artifactHandler = artifact.getArtifactHandler();
                     middle = artifactHandler.getExtension();
@@ -414,18 +412,6 @@
     }
 
     /**
-     * Get the files to be excluded and put it into list.
-     *
-     * @return l List of filename patterns to be excluded.
-     */
-    private static List getJarExcludes()
-    {
-        List l = new ArrayList( getDefaultExcludes() );
-        l.add( "META-INF/**" );
-        return l;
-    }
-
-    /**
      * Get the Output Directory by parsing the String output directory.
      *
      * @param output The string representation of the output directory.
@@ -486,11 +472,11 @@
                 TarArchiver.TarCompressionMethod tarCompressionMethod = new TarArchiver.TarCompressionMethod();
                 // TODO: this should accept gz and bz2 as well so we can skip over the switch
                 String compression = format.substring( index + 1 );
-                if ( compression.equals( "gz" ) )
+                if ( "gz".equals( compression ) )
                 {
                     tarCompressionMethod.setValue( "gzip" );
                 }
-                else if ( compression.equals( "bz2" ) )
+                else if ( "bz2".equals( compression ) )
                 {
                     tarCompressionMethod.setValue( "bzip2" );
                 }
@@ -619,15 +605,15 @@
     {
         if ( lineEnding != null )
         {
-            if ( lineEnding.equals( "keep" ) )
+            if ( "keep".equals( lineEnding ) )
             {
                 lineEnding = null;
             }
-            else if ( lineEnding.equals( "dos" ) || lineEnding.equals( "crlf" ) )
+            else if ( "dos".equals( lineEnding ) || "crlf".equals( lineEnding ) )
             {
                 lineEnding = "\r\n";
             }
-            else if ( lineEnding.equals( "unix" ) || lineEnding.equals( "lf" ) )
+            else if ( "unix".equals( lineEnding ) || "lf".equals( lineEnding ) )
             {
                 lineEnding = "\n";
             }



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