You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by da...@apache.org on 2010/01/01 08:19:39 UTC

svn commit: r894977 - in /maven/plugins/trunk/maven-dependency-plugin/src: main/java/org/apache/maven/plugin/dependency/ main/java/org/apache/maven/plugin/dependency/fromConfiguration/ main/java/org/apache/maven/plugin/dependency/utils/ test/java/org/a...

Author: dantran
Date: Fri Jan  1 07:19:33 2010
New Revision: 894977

URL: http://svn.apache.org/viewvc?rev=894977&view=rev
Log:
revere r894970, excludeClassifers is broker, need IT first

Modified:
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyUtil.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/TestDependencyUtil.java

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java?rev=894977&r1=894976&r2=894977&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java Fri Jan  1 07:19:33 2010
@@ -1,18 +1,22 @@
 package org.apache.maven.plugin.dependency;
 
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at
- * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
  */
 
 import java.io.File;
@@ -21,7 +25,6 @@
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.dependency.utils.DependencyStatusSets;
-import org.apache.maven.plugin.dependency.utils.DependencyUtil;
 import org.apache.maven.plugin.dependency.utils.resolvers.ArtifactsResolver;
 import org.apache.maven.plugin.dependency.utils.resolvers.DefaultArtifactsResolver;
 import org.apache.maven.plugin.dependency.utils.translators.ArtifactTranslator;
@@ -215,8 +218,7 @@
      * @return A HashSet of artifacts
      * @throws MojoExecutionException 
      */
-    protected Set getResolvedDependencies( boolean stopOnFailure )
-        throws MojoExecutionException
+    protected Set getResolvedDependencies( boolean stopOnFailure )throws MojoExecutionException
 
     {
         DependencyStatusSets status = getDependencySets( stopOnFailure );
@@ -242,21 +244,11 @@
         FilterArtifacts filter = new FilterArtifacts();
 
         filter.addFilter( new TransitivityFilter( project.getDependencyArtifacts(), this.excludeTransitive ) );
-
-        filter.addFilter( new ScopeFilter( DependencyUtil.cleanToBeTokenizedString( this.includeScope ), DependencyUtil
-            .cleanToBeTokenizedString( this.excludeScope ) ) );
-
-        filter.addFilter( new TypeFilter( DependencyUtil.cleanToBeTokenizedString( this.includeTypes ), DependencyUtil
-            .cleanToBeTokenizedString( this.excludeTypes ) ) );
-
-        filter.addFilter( new ClassifierFilter( DependencyUtil.cleanToBeTokenizedString( this.includeClassifiers ),
-                                                DependencyUtil.cleanToBeTokenizedString( this.excludeClassifiers ) ) );
-
-        filter.addFilter( new GroupIdFilter( DependencyUtil.cleanToBeTokenizedString( this.includeGroupIds ),
-                                             DependencyUtil.cleanToBeTokenizedString( this.excludeGroupIds ) ) );
-
-        filter.addFilter( new ArtifactIdFilter( DependencyUtil.cleanToBeTokenizedString( this.includeArtifactIds ),
-                                                DependencyUtil.cleanToBeTokenizedString( this.excludeArtifactIds ) ) );
+        filter.addFilter( new ScopeFilter( this.includeScope, this.excludeScope ) );
+        filter.addFilter( new TypeFilter( this.includeTypes, this.excludeTypes ) );
+        filter.addFilter( new ClassifierFilter( this.includeClassifiers, this.excludeClassifiers ) );
+        filter.addFilter( new GroupIdFilter( this.includeGroupIds, this.excludeGroupIds ) );
+        filter.addFilter( new ArtifactIdFilter( this.includeArtifactIds, this.excludeArtifactIds ) );
 
         // start with all artifacts.
         Set artifacts = project.getArtifacts();
@@ -268,7 +260,7 @@
         }
         catch ( ArtifactFilterException e )
         {
-            throw new MojoExecutionException( e.getMessage(), e );
+            throw new MojoExecutionException(e.getMessage(),e);
         }
 
         // transform artifacts if classifier is set
@@ -354,7 +346,7 @@
         }
         catch ( ArtifactFilterException e )
         {
-            throw new MojoExecutionException( e.getMessage(), e );
+            throw new MojoExecutionException(e.getMessage(),e);
         }
 
         // calculate the skipped artifacts

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java?rev=894977&r1=894976&r2=894977&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java Fri Jan  1 07:19:33 2010
@@ -111,7 +111,7 @@
      */
     public String getExcludes ()
     {
-        return DependencyUtil.cleanToBeTokenizedString( this.excludes );
+        return this.excludes;
     }
     
     /**
@@ -125,16 +125,16 @@
     }
     
     /**
-     * @return Returns a comma separated list of included items
+     * @return Returns a comma seperated list of included items
      */
     public String getIncludes()
     {
-        return DependencyUtil.cleanToBeTokenizedString( this.includes );
+    	return this.includes;
     }
 
     /**
      * @param includes
-     * 			A comma separated list of items to include 
+     * 			A comma seperated list of items to inmclude 
      * 			i.e.  **\/*.xml, **\/*.properties
      */
     public void setIncludes ( String includes )

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.java?rev=894977&r1=894976&r2=894977&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.java Fri Jan  1 07:19:33 2010
@@ -22,7 +22,6 @@
 import java.io.File;
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.plugin.dependency.utils.DependencyUtil;
 import org.codehaus.plexus.util.StringUtils;
 
 /**
@@ -329,7 +328,7 @@
      */
     public String getExcludes ()
     {
-        return DependencyUtil.cleanToBeTokenizedString( this.excludes );
+        return this.excludes;
     }
     
     /**
@@ -347,7 +346,7 @@
      */
     public String getIncludes()
     {
-    	return DependencyUtil.cleanToBeTokenizedString( this.includes );
+    	return this.includes;
     }
 
     /**

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyUtil.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyUtil.java?rev=894977&r1=894976&r2=894977&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyUtil.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyUtil.java Fri Jan  1 07:19:33 2010
@@ -226,26 +226,4 @@
 
         reader.close();
     }
-
-    //
-    // mainly used to parse excludes,includes configuration
-    //
-    public static String [] tokenizer( String str )
-    {
-        return StringUtils.split( cleanToBeTokenizedString( str ), "," );
-    }
-    
-    //
-    // clean up configuration string before it can be tokenized
-    //
-    public static String cleanToBeTokenizedString( String str )
-    {
-        String ret = "";
-        if ( ! StringUtils.isEmpty( str ) )
-        {
-            ret = StringUtils.join( StringUtils.split( str ), "," );
-        }
-        
-        return ret;
-    }    
 }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/TestDependencyUtil.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/TestDependencyUtil.java?rev=894977&r1=894976&r2=894977&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/TestDependencyUtil.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/TestDependencyUtil.java Fri Jan  1 07:19:33 2010
@@ -259,20 +259,4 @@
         assertEquals( expectedResult, name );
 
     }
-    
-    public void testTokenizer()
-    {
-        
-        String [] tokens = DependencyUtil.tokenizer( " \r\n a, \t \n \r b \t \n \r" );
-        assertEquals( 2, tokens.length );
-        assertEquals( "a", tokens[0] );
-        assertEquals( "b", tokens[1] );
-        
-        tokens = DependencyUtil.tokenizer( null );
-        assertEquals( 0, tokens.length );
-        
-        tokens = DependencyUtil.tokenizer( "  " );
-        assertEquals( 0, tokens.length );
-        
-    }
 }