You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2007/02/13 04:28:22 UTC

svn commit: r506840 [1/2] - 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/resolvers/ main/...

Author: brianf
Date: Mon Feb 12 19:28:20 2007
New Revision: 506840

URL: http://svn.apache.org/viewvc?view=rev&rev=506840
Log:
MDEP-63

Added:
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo2.java
Modified:
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractFromDependenciesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/BuildClasspathMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.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/AbstractFromConfigurationMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.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/main/java/org/apache/maven/plugin/dependency/utils/filters/AbstractArtifactFeatureFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/GroupIdFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/markers/SourcesFileMarkerHandler.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ClassifierTypeTranslator.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/AbstractDependencyMojoTestCase.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestBuildClasspathMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestResolveMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestArtifactItem.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestCopyMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestUnpackMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/ArtifactStubFactory.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/DependencyTestUtils.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DependencyProjectStub.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubArtifactCollector.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubArtifactRepository.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubArtifactResolver.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubDefaultFileMarkerHandler.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubMarkerFile.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubSourcesFileMarkerHandler.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/TestDependencyStatusSets.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/TestDependencyUtil.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/TestSilentLog.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestDestFileFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestFilterArtifacts.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestGroupIdFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestMarkerFileFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestResolveMarkerFileFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestScopeFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestTransitivityFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestTypeFilter.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/markers/TestDefaultMarkerFileHandler.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/translators/TestClassifierTypeTranslator.java

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java Mon Feb 12 19:28:20 2007
@@ -73,12 +73,13 @@
     protected ArtifactCollector artifactCollector;
 
     /**
-     * @component role="org.apache.maven.artifact.metadata.ArtifactMetadataSource" hint="maven"
+     * @component role="org.apache.maven.artifact.metadata.ArtifactMetadataSource"
+     *            hint="maven"
      * @required
      * @readonly
      */
     protected ArtifactMetadataSource artifactMetadataSource;
-    
+
     /**
      * Location of the local repository.
      * 
@@ -223,11 +224,11 @@
 
             unArchiver.setDestDirectory( location );
 
-            if (this.silent)
+            if ( this.silent )
             {
-                silenceUnarchiver(unArchiver);
+                silenceUnarchiver( unArchiver );
             }
-            
+
             unArchiver.extract();
         }
         catch ( NoSuchArchiverException e )
@@ -361,7 +362,8 @@
     }
 
     /**
-     * @param theArtifactCollector The artifactCollector to set.
+     * @param theArtifactCollector
+     *            The artifactCollector to set.
      */
     public void setArtifactCollector( ArtifactCollector theArtifactCollector )
     {
@@ -377,7 +379,8 @@
     }
 
     /**
-     * @param theArtifactMetadataSource The artifactMetadataSource to set.
+     * @param theArtifactMetadataSource
+     *            The artifactMetadataSource to set.
      */
     public void setArtifactMetadataSource( ArtifactMetadataSource theArtifactMetadataSource )
     {

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractFromDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractFromDependenciesMojo.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractFromDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractFromDependenciesMojo.java Mon Feb 12 19:28:20 2007
@@ -33,6 +33,15 @@
 {
 
     /**
+     * Strip artifact version during copy
+     * 
+     * @optional
+     * @parameter expression="${stripVersion}" default-value="false"
+     * @parameter
+     */
+    protected boolean stripVersion = false;
+
+    /**
      * Default location used for mojo unless overridden in ArtifactItem
      * 
      * @parameter expression="${outputDirectory}"
@@ -63,7 +72,6 @@
      */
     protected boolean useSubDirectoryPerArtifact;
 
-    
     /**
      * This only applies if the classifier parameter is used.
      * 
@@ -73,7 +81,7 @@
      * @optional
      */
     protected boolean failOnMissingClassifierArtifact = true;
-    
+
     /**
      * @return Returns the outputDirectory.
      */
@@ -83,7 +91,8 @@
     }
 
     /**
-     * @param theOutputDirectory The outputDirectory to set.
+     * @param theOutputDirectory
+     *            The outputDirectory to set.
      */
     public void setOutputDirectory( File theOutputDirectory )
     {
@@ -99,7 +108,8 @@
     }
 
     /**
-     * @param theUseSubDirectoryPerArtifact The useSubDirectoryPerArtifact to set.
+     * @param theUseSubDirectoryPerArtifact
+     *            The useSubDirectoryPerArtifact to set.
      */
     public void setUseSubDirectoryPerArtifact( boolean theUseSubDirectoryPerArtifact )
     {
@@ -115,11 +125,32 @@
     }
 
     /**
-     * @param theUseSubDirectoryPerType The useSubDirectoryPerType to set.
+     * @param theUseSubDirectoryPerType
+     *            The useSubDirectoryPerType to set.
      */
     public void setUseSubDirectoryPerType( boolean theUseSubDirectoryPerType )
     {
         this.useSubDirectoryPerType = theUseSubDirectoryPerType;
+    }
+
+    public boolean isFailOnMissingClassifierArtifact()
+    {
+        return failOnMissingClassifierArtifact;
+    }
+
+    public void setFailOnMissingClassifierArtifact( boolean failOnMissingClassifierArtifact )
+    {
+        this.failOnMissingClassifierArtifact = failOnMissingClassifierArtifact;
+    }
+
+    public boolean isStripVersion()
+    {
+        return stripVersion;
+    }
+
+    public void setStripVersion( boolean stripVersion )
+    {
+        this.stripVersion = stripVersion;
     }
 
 }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java Mon Feb 12 19:28:20 2007
@@ -46,7 +46,7 @@
      * @readonly
      */
     protected MavenProjectBuilder mavenProjectBuilder;
-    
+
     /**
      * This method resolves the dependency artifacts from the project.
      * 

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/BuildClasspathMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/BuildClasspathMojo.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/BuildClasspathMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/BuildClasspathMojo.java Mon Feb 12 19:28:20 2007
@@ -38,7 +38,8 @@
 import org.apache.maven.plugin.dependency.utils.filters.ArtifactsFilter;
 
 /**
- *  This goal will output a classpath string of dependencies from the local repository to a file or log.
+ * This goal will output a classpath string of dependencies from the local
+ * repository to a file or log.
  * 
  * @goal build-classpath
  * @requiresDependencyResolution compile
@@ -83,7 +84,7 @@
      * @parameter default-value="false" expression="${maven.dep.regenerateFile}"
      */
     private boolean regenerateFile;
-    
+
     /**
      * Main entry into mojo. Gets the list of dependencies and iterates through
      * calling copyArtifact.
@@ -105,7 +106,7 @@
         }
 
         List artList = new ArrayList( artifacts );
-            
+
         StringBuffer sb = new StringBuffer();
         Iterator i = artList.iterator();
 
@@ -258,13 +259,16 @@
     /**
      * Compares artifacts lexicographically, using pattern
      * [group_id][artifact_id][version].
-     * @param arg1 first object
-     * @param arg2 second object
-     * @return  the value <code>0</code> if the argument string is equal to
-     *          this string; a value less than <code>0</code> if this string
-     *          is lexicographically less than the string argument; and a
-     *          value greater than <code>0</code> if this string is
-     *          lexicographically greater than the string argument.
+     * 
+     * @param arg1
+     *            first object
+     * @param arg2
+     *            second object
+     * @return the value <code>0</code> if the argument string is equal to
+     *         this string; a value less than <code>0</code> if this string is
+     *         lexicographically less than the string argument; and a value
+     *         greater than <code>0</code> if this string is lexicographically
+     *         greater than the string argument.
      */
     public int compare( Object arg1, Object arg2 )
     {

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java Mon Feb 12 19:28:20 2007
@@ -45,15 +45,6 @@
 {
 
     /**
-     * Strip artifact version during copy
-     * 
-     * @optional
-     * @parameter expression="${stripVersion}" default-value="false"
-     * @parameter
-     */
-    protected boolean stripVersion = false;
-
-    /**
      * Main entry into mojo. Gets the list of dependencies and iterates through
      * calling copyArtifact.
      * 
@@ -106,7 +97,7 @@
         String destFileName = DependencyUtil.getFormattedFileName( artifact, removeVersion );
 
         File destDir = DependencyUtil.getFormattedOutputDirectory( this.useSubDirectoryPerType,
-                                                                   this.useSubDirectoryPerArtifact,
+                                                                   this.useSubDirectoryPerArtifact, this.stripVersion,
                                                                    this.outputDirectory, artifact );
         File destFile = new File( destDir, destFileName );
 

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?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- 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 Mon Feb 12 19:28:20 2007
@@ -67,7 +67,8 @@
             Artifact artifact = (Artifact) i.next();
             File destDir = DependencyUtil.getFormattedOutputDirectory( this.useSubDirectoryPerType,
                                                                        this.useSubDirectoryPerArtifact,
-                                                                       this.outputDirectory, artifact );
+                                                                       this.stripVersion, this.outputDirectory,
+                                                                       artifact );
 
             unpack( artifact.getFile(), destDir );
             DefaultFileMarkerHandler handler = new DefaultFileMarkerHandler( artifact, this.markersDirectory );

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java Mon Feb 12 19:28:20 2007
@@ -180,8 +180,6 @@
         return result;
     }
 
-  
-
     /**
      * Resolves the Artifact from the remote repository if nessessary. If no
      * version is specified, it will be retrieved from the dependency list or
@@ -222,28 +220,29 @@
         else
         {
             artifact = factory.createDependencyArtifact( artifactItem.getGroupId(), artifactItem.getArtifactId(), vr,
-                                                         artifactItem.getType(), artifactItem.getClassifier(), Artifact.SCOPE_COMPILE );
+                                                         artifactItem.getType(), artifactItem.getClassifier(),
+                                                         Artifact.SCOPE_COMPILE );
         }
 
         try
         {
-            //mdep-50 - rolledback for now because it's breaking some functionality.
-         /*   List listeners = new ArrayList();
-
-            Set theSet = new HashSet();
-            theSet.add( artifact );
-            ArtifactResolutionResult artifactResolutionResult = artifactCollector.collect( theSet, project
-                .getArtifact(), managedVersions, this.local, project.getRemoteArtifactRepositories(),
-                                                                                           artifactMetadataSource,
-                                                                                           null, listeners );
-            Iterator iter = artifactResolutionResult.getArtifactResolutionNodes().iterator();
-            while ( iter.hasNext() )
-            {
-                ResolutionNode node = (ResolutionNode) iter.next();
-                artifact = node.getArtifact();
-            }*/
+            // mdep-50 - rolledback for now because it's breaking some
+            // functionality.
+            /*
+             * List listeners = new ArrayList();
+             * 
+             * Set theSet = new HashSet(); theSet.add( artifact );
+             * ArtifactResolutionResult artifactResolutionResult =
+             * artifactCollector.collect( theSet, project .getArtifact(),
+             * managedVersions, this.local,
+             * project.getRemoteArtifactRepositories(), artifactMetadataSource,
+             * null, listeners ); Iterator iter =
+             * artifactResolutionResult.getArtifactResolutionNodes().iterator();
+             * while ( iter.hasNext() ) { ResolutionNode node = (ResolutionNode)
+             * iter.next(); artifact = node.getArtifact(); }
+             */
 
-             resolver.resolve( artifact, remoteRepos, local );
+            resolver.resolve( artifact, remoteRepos, local );
         }
         catch ( ArtifactResolutionException e )
         {

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java Mon Feb 12 19:28:20 2007
@@ -100,11 +100,9 @@
 
     protected ArtifactItemFilter getMarkedArtifactFilter( ArtifactItem item )
     {
-        ArtifactItemFilter destinationNameOverrideFilter = new DestFileFilter( this.isOverWriteReleases(),
-                                                                               this.isOverWriteSnapshots(),
-                                                                               this.isOverWriteIfNewer(), false, false,
-                                                                               this.stripVersion, item
-                                                                                   .getOutputDirectory() );
+        ArtifactItemFilter destinationNameOverrideFilter = new DestFileFilter( this.isOverWriteReleases(), this
+            .isOverWriteSnapshots(), this.isOverWriteIfNewer(), false, false, this.stripVersion, item
+            .getOutputDirectory() );
         return destinationNameOverrideFilter;
     }
 

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java Mon Feb 12 19:28:20 2007
@@ -19,7 +19,6 @@
  * under the License.    
  */
 
-
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.dependency.AbstractResolveMojo;
 import org.apache.maven.plugin.dependency.utils.DependencyStatusSets;
@@ -39,7 +38,7 @@
 public class ResolveDependenciesMojo
     extends AbstractResolveMojo
 {
-    
+
     /**
      * If we should display the scope when resolving
      * 

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java Mon Feb 12 19:28:20 2007
@@ -1,4 +1,5 @@
 package org.apache.maven.plugin.dependency.resolvers;
+
 /* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -39,9 +40,9 @@
     extends AbstractResolveMojo
 {
 
-   // private static final String SOURCE_TYPE = "java-source";
+    // private static final String SOURCE_TYPE = "java-source";
 
-  //  private static final String SOURCE_CLASSIFIER = "sources";
+    // private static final String SOURCE_CLASSIFIER = "sources";
 
     /**
      * If the plugin should exclude Transitive dependencies.
@@ -65,15 +66,13 @@
      *            default-value="${project.build.directory}/dependency-maven-plugin-markers"
      * @required
      */
-//    private File markersDirectory;
-
+    // private File markersDirectory;
     /**
      * Use Marker Files
      * 
      * @parameter expression="${dependency.useMarkers}" default-value="false"
      */
-//    private boolean useMarkers;
-
+    // private boolean useMarkers;
     /**
      * Main entry into mojo. Gets the list of dependencies and iterates through
      * resolving the source jars.

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java Mon Feb 12 19:28:20 2007
@@ -169,9 +169,8 @@
                         artifactFilename = null;
                     }
                 }
-                log.info( "   " + artifact.getId()
-                    + ( outputAbsoluteArtifactFilename ? ":" + artifactFilename : "" )
-                    + ( outputScope ? " (scope = " + artifact.getScope() + ")" : "" ));
+                log.info( "   " + artifact.getId() + ( outputAbsoluteArtifactFilename ? ":" + artifactFilename : "" )
+                    + ( outputScope ? " (scope = " + artifact.getScope() + ")" : "" ) );
             }
         }
 

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?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- 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 Mon Feb 12 19:28:20 2007
@@ -32,6 +32,7 @@
  */
 public final class DependencyUtil
 {
+
     /**
      * Builds the file name. If removeVersion is set, then the file name must be
      * reconstructed from the artifactId, Classifier (if used) and Type.
@@ -48,12 +49,14 @@
     {
         String destFileName = null;
 
-        //if there is a file and we aren't stripping the version, just get the name directly
+        // if there is a file and we aren't stripping the version, just get the
+        // name directly
         if ( artifact.getFile() != null && !removeVersion )
         {
             destFileName = artifact.getFile().getName();
         }
-        else //if offline
+        else
+        // if offline
         {
             String versionString = null;
             if ( !removeVersion )
@@ -64,7 +67,7 @@
             {
                 versionString = "";
             }
-            
+
             String classifierString = "";
 
             if ( StringUtils.isNotEmpty( artifact.getClassifier() ) )
@@ -72,7 +75,8 @@
                 classifierString = "-" + artifact.getClassifier();
             }
 
-            destFileName = artifact.getArtifactId() + versionString + classifierString + "." + artifact.getArtifactHandler().getExtension();
+            destFileName = artifact.getArtifactId() + versionString + classifierString + "."
+                + artifact.getArtifactHandler().getExtension();
         }
         return destFileName;
     }
@@ -92,18 +96,18 @@
      * @return a formatted File object to use for output.
      */
     public static File getFormattedOutputDirectory( boolean useSubdirsPerType, boolean useSubdirPerArtifact,
-                                                   File outputDirectory, Artifact artifact )
+                                                   boolean removeVersion, File outputDirectory, Artifact artifact )
     {
         File result = null;
+        String artifactString = getDependencyId(artifact,removeVersion);
 
-        // get id but convert the chars so it's safe as a folder name.
-        String artifactId = artifact.getId().replace( ':', '-' );
+        
         if ( !useSubdirsPerType )
         {
             if ( useSubdirPerArtifact )
             {
 
-                result = new File( outputDirectory.getAbsolutePath() + File.separatorChar + artifactId
+                result = new File( outputDirectory.getAbsolutePath() + File.separatorChar + artifactString
                     + File.separatorChar );
             }
             else
@@ -116,7 +120,7 @@
             if ( useSubdirPerArtifact )
             {
                 result = new File( outputDirectory.getAbsolutePath() + File.separatorChar + artifact.getType() + "s"
-                    + File.separatorChar + artifactId + File.separatorChar );
+                    + File.separatorChar + artifactString + File.separatorChar );
             }
             else
             {
@@ -127,5 +131,37 @@
 
         return result;
 
+    }
+    
+    private static String getDependencyId(Artifact artifact,boolean removeVersion)
+    {
+        StringBuffer sb = new StringBuffer();
+        
+        sb.append( artifact.getArtifactId() );
+        
+        if (StringUtils.isNotEmpty(artifact.getClassifier()))
+        {
+            sb.append("-");
+            sb.append(artifact.getClassifier());
+        }
+        
+        if (!removeVersion)
+        {
+            sb.append("-");
+            sb.append(artifact.getVersion());
+            sb.append("-");
+            sb.append( artifact.getType() );
+        }
+        else
+        {
+            //if the classifier and type are the same (sources), then don't repeat.
+            //avoids names like foo-sources-sources
+            if (!StringUtils.equals(artifact.getClassifier(),artifact.getType()))
+            {
+                sb.append("-");
+                sb.append( artifact.getType() );
+            }
+        }     
+        return sb.toString();
     }
 }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/AbstractArtifactFeatureFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/AbstractArtifactFeatureFilter.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/AbstractArtifactFeatureFilter.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/AbstractArtifactFeatureFilter.java Mon Feb 12 19:28:20 2007
@@ -155,7 +155,7 @@
             while ( excludeIter.hasNext() )
             {
                 String excludeFeature = (String) excludeIter.next();
-                if (compareFeatures(artifactFeature, excludeFeature ) )
+                if ( compareFeatures( artifactFeature, excludeFeature ) )
                 {
                     exclude = true;
                     break;
@@ -216,14 +216,18 @@
     {
         return this.includes;
     }
-    
+
     /**
      * Allows Feature comparison to be customized
-     * @param lhs String artifact's feature
-     * @param rhs String feature from exclude or include list
+     * 
+     * @param lhs
+     *            String artifact's feature
+     * @param rhs
+     *            String feature from exclude or include list
      * @return boolean true if features match
      */
-    protected boolean compareFeatures(String lhs, String rhs){
-    	return(lhs.equals(rhs));
+    protected boolean compareFeatures( String lhs, String rhs )
+    {
+        return ( lhs.equals( rhs ) );
     }
 }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/DestFileFilter.java Mon Feb 12 19:28:20 2007
@@ -243,7 +243,8 @@
         {
             destFolder = DependencyUtil.getFormattedOutputDirectory( this.useSubDirectoryPerType,
                                                                      this.useSubDirectoryPerArtifact,
-                                                                     this.outputFileDirectory, artifact );
+                                                                     this.removeVersion, this.outputFileDirectory,
+                                                                     artifact );
         }
 
         File destFile = null;

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/GroupIdFilter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/GroupIdFilter.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/GroupIdFilter.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/GroupIdFilter.java Mon Feb 12 19:28:20 2007
@@ -75,15 +75,16 @@
     {
         return artifact.getGroupId();
     }
-    
+
     /*
      * (non-Javadoc)
      * 
      * @see org.apache.maven.plugin.dependency.utils.filters.AbstractArtifactFeatureFilter#compareFeatures(String,String)
      */
-    
-    protected boolean compareFeatures(String lhs, String rhs){
-    	return lhs.startsWith(rhs);
+
+    protected boolean compareFeatures( String lhs, String rhs )
+    {
+        return lhs.startsWith( rhs );
     }
-    
+
 }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/markers/SourcesFileMarkerHandler.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/markers/SourcesFileMarkerHandler.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/markers/SourcesFileMarkerHandler.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/markers/SourcesFileMarkerHandler.java Mon Feb 12 19:28:20 2007
@@ -63,7 +63,8 @@
     /**
      * Get MarkerFile, exposed for unit testing purposes
      * 
-     * @param is resolved or not.
+     * @param is
+     *            resolved or not.
      * @return marker file for this artifact.
      */
     protected File getMarkerFile( boolean res )
@@ -135,14 +136,15 @@
         // get the other file if it exists.
         File clearMarker = getMarkerFile( !this.resolved );
         // create marker file
-        try {
-        marker.getParentFile().mkdirs();
+        try
+        {
+            marker.getParentFile().mkdirs();
         }
-        catch (NullPointerException e)
+        catch ( NullPointerException e )
         {
-            //parent is null, ignore it.
+            // parent is null, ignore it.
         }
-        
+
         try
         {
             marker.createNewFile();

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ClassifierTypeTranslator.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ClassifierTypeTranslator.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ClassifierTypeTranslator.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ClassifierTypeTranslator.java Mon Feb 12 19:28:20 2007
@@ -107,7 +107,6 @@
         return results;
     }
 
-
     /**
      * @return Returns the type.
      */
@@ -134,7 +133,8 @@
     }
 
     /**
-     * @param theClassifier The classifier to set.
+     * @param theClassifier
+     *            The classifier to set.
      */
     public void setClassifier( String theClassifier )
     {

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/AbstractDependencyMojoTestCase.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/AbstractDependencyMojoTestCase.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/AbstractDependencyMojoTestCase.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/AbstractDependencyMojoTestCase.java Mon Feb 12 19:28:20 2007
@@ -1,4 +1,5 @@
 package org.apache.maven.plugin.dependency;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestBuildClasspathMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestBuildClasspathMojo.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestBuildClasspathMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestBuildClasspathMojo.java Mon Feb 12 19:28:20 2007
@@ -50,7 +50,7 @@
         assertNotNull( mojo.getProject() );
         MavenProject project = mojo.getProject();
 
-        //mojo.silent = true;
+        // mojo.silent = true;
         Set artifacts = this.stubFactory.getScopedArtifacts();
         Set directArtifacts = this.stubFactory.getReleaseAndSnapshotArtifacts();
         artifacts.addAll( directArtifacts );

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java Mon Feb 12 19:28:20 2007
@@ -321,7 +321,8 @@
         {
             Artifact artifact = (Artifact) iter.next();
             String fileName = DependencyUtil.getFormattedFileName( artifact, false );
-            File folder = DependencyUtil.getFormattedOutputDirectory( true, false, mojo.outputDirectory, artifact );
+            File folder = DependencyUtil.getFormattedOutputDirectory( true, false, false, mojo.outputDirectory,
+                                                                      artifact );
             File file = new File( folder, fileName );
             assertTrue( file.exists() );
         }
@@ -338,7 +339,8 @@
         {
             Artifact artifact = (Artifact) iter.next();
             String fileName = DependencyUtil.getFormattedFileName( artifact, false );
-            File folder = DependencyUtil.getFormattedOutputDirectory( false, true, mojo.outputDirectory, artifact );
+            File folder = DependencyUtil.getFormattedOutputDirectory( false, true, false, mojo.outputDirectory,
+                                                                      artifact );
             File file = new File( folder, fileName );
             assertTrue( file.exists() );
         }
@@ -358,108 +360,50 @@
         {
             Artifact artifact = (Artifact) iter.next();
             String fileName = DependencyUtil.getFormattedFileName( artifact, false );
-            File folder = DependencyUtil.getFormattedOutputDirectory( true, true, mojo.outputDirectory, artifact );
+            File folder = DependencyUtil
+                .getFormattedOutputDirectory( true, true, false, mojo.outputDirectory, artifact );
             File file = new File( folder, fileName );
             assertTrue( file.exists() );
         }
     }
 
-    public void testCopyDependenciesMojoIncludeCompileScope()
+    public void testCopyDependenciesMojoSubPerArtifactRemoveVersion()
         throws Exception
     {
-        mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
-        mojo.project.setDependencyArtifacts( new HashSet() );
-        mojo.includeScope = "compile";
-        mojo.execute();
-        ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.includeScope );
-
-        Iterator iter = mojo.project.getArtifacts().iterator();
-        while ( iter.hasNext() )
-        {
-            Artifact artifact = (Artifact) iter.next();
-            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
-            File file = new File( mojo.outputDirectory, fileName );
-
-            assertEquals( saf.include( artifact ), file.exists() );
-        }
-    }
-
-    public void testCopyDependenciesMojoIncludeTestScope()
-        throws Exception
-    {
-        mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
-        mojo.project.setDependencyArtifacts( new HashSet() );
-        mojo.includeScope = "test";
-
-        mojo.execute();
-        ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.includeScope );
-
-        Iterator iter = mojo.project.getArtifacts().iterator();
-        while ( iter.hasNext() )
-        {
-            Artifact artifact = (Artifact) iter.next();
-            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
-            File file = new File( mojo.outputDirectory, fileName );
-
-            assertEquals( saf.include( artifact ), file.exists() );
-        }
-    }
-
-    public void testCopyDependenciesMojoIncludeRuntimeScope()
-        throws Exception
-    {
-        mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
-        mojo.project.setDependencyArtifacts( new HashSet() );
-        mojo.includeScope = "runtime";
+        mojo.useSubDirectoryPerArtifact = true;
+        mojo.stripVersion = true;
         mojo.execute();
-        ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.includeScope );
-
-        Iterator iter = mojo.project.getArtifacts().iterator();
-        while ( iter.hasNext() )
-        {
-            Artifact artifact = (Artifact) iter.next();
-            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
-            File file = new File( mojo.outputDirectory, fileName );
-
-            assertEquals( saf.include( artifact ), file.exists() );
-        }
-    }
-
-    public void testCopyDependenciesMojoIncludeprovidedScope()
-        throws Exception
-    {
-        mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
-        mojo.project.setDependencyArtifacts( new HashSet() );
-        mojo.includeScope = "provided";
 
-        mojo.execute();
         Iterator iter = mojo.project.getArtifacts().iterator();
         while ( iter.hasNext() )
         {
             Artifact artifact = (Artifact) iter.next();
-            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
-            File file = new File( mojo.outputDirectory, fileName );
-            assertEquals( Artifact.SCOPE_PROVIDED.equals( artifact.getScope() ), file.exists() );
+            String fileName = DependencyUtil.getFormattedFileName( artifact, true );
+            File folder = DependencyUtil
+                .getFormattedOutputDirectory( false, true, true, mojo.outputDirectory, artifact );
+            File file = new File( folder, fileName );
+            assertTrue( file.exists() );
         }
     }
 
-    public void testCopyDependenciesMojoIncludesystemScope()
+    public void testCopyDependenciesMojoSubPerArtifactAndTypeRemoveVersion()
         throws Exception
     {
-        mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
+        mojo.project.setArtifacts( stubFactory.getTypedArtifacts() );
         mojo.project.setDependencyArtifacts( new HashSet() );
-        mojo.includeScope = "system";
-
+        mojo.useSubDirectoryPerArtifact = true;
+        mojo.useSubDirectoryPerType = true;
+        mojo.stripVersion = true;
         mojo.execute();
 
         Iterator iter = mojo.project.getArtifacts().iterator();
         while ( iter.hasNext() )
         {
             Artifact artifact = (Artifact) iter.next();
-            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
-            File file = new File( mojo.outputDirectory, fileName );
-
-            assertEquals( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ), file.exists() );
+            String fileName = DependencyUtil.getFormattedFileName( artifact, true );
+            File folder = DependencyUtil.getFormattedOutputDirectory( true, true, true, mojo.outputDirectory, artifact );
+            File file = new File( folder, fileName );
+            assertTrue( file.exists() );
         }
     }
 

Added: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo2.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo2.java?view=auto&rev=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo2.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo2.java Mon Feb 12 19:28:20 2007
@@ -0,0 +1,179 @@
+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
+ *
+ *  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.
+ */
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.dependency.utils.DependencyUtil;
+import org.apache.maven.plugin.dependency.utils.markers.DefaultFileMarkerHandler;
+import org.apache.maven.project.MavenProject;
+
+public class TestCopyDependenciesMojo2
+    extends AbstractDependencyMojoTestCase
+{
+
+    CopyDependenciesMojo mojo;
+
+    protected void setUp()
+        throws Exception
+    {
+        // required for mojo lookups to work
+        super.setUp( "copy-dependencies", true );
+
+        File testPom = new File( getBasedir(), "target/test-classes/unit/copy-dependencies-test/plugin-config.xml" );
+        mojo = (CopyDependenciesMojo) lookupMojo( "copy-dependencies", testPom );
+        mojo.outputDirectory = new File( this.testDir, "outputDirectory" );
+        // mojo.silent = true;
+
+        assertNotNull( mojo );
+        assertNotNull( mojo.getProject() );
+        MavenProject project = mojo.getProject();
+
+        Set artifacts = this.stubFactory.getScopedArtifacts();
+        Set directArtifacts = this.stubFactory.getReleaseAndSnapshotArtifacts();
+        artifacts.addAll( directArtifacts );
+
+        project.setArtifacts( artifacts );
+        project.setDependencyArtifacts( directArtifacts );
+        mojo.markersDirectory = new File( this.testDir, "markers" );
+
+    }
+
+    public void assertNoMarkerFile( Artifact artifact )
+    {
+        DefaultFileMarkerHandler handle = new DefaultFileMarkerHandler( artifact, mojo.markersDirectory );
+        try
+        {
+            assertFalse( handle.isMarkerSet() );
+        }
+        catch ( MojoExecutionException e )
+        {
+            fail( e.getLongMessage() );
+        }
+
+    }
+
+
+    public void testCopyDependenciesMojoIncludeCompileScope()
+        throws Exception
+    {
+        mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
+        mojo.project.setDependencyArtifacts( new HashSet() );
+        mojo.includeScope = "compile";
+        mojo.execute();
+        ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.includeScope );
+
+        Iterator iter = mojo.project.getArtifacts().iterator();
+        while ( iter.hasNext() )
+        {
+            Artifact artifact = (Artifact) iter.next();
+            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
+            File file = new File( mojo.outputDirectory, fileName );
+
+            assertEquals( saf.include( artifact ), file.exists() );
+        }
+    }
+
+    public void testCopyDependenciesMojoIncludeTestScope()
+        throws Exception
+    {
+        mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
+        mojo.project.setDependencyArtifacts( new HashSet() );
+        mojo.includeScope = "test";
+
+        mojo.execute();
+        ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.includeScope );
+
+        Iterator iter = mojo.project.getArtifacts().iterator();
+        while ( iter.hasNext() )
+        {
+            Artifact artifact = (Artifact) iter.next();
+            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
+            File file = new File( mojo.outputDirectory, fileName );
+
+            assertEquals( saf.include( artifact ), file.exists() );
+        }
+    }
+
+    public void testCopyDependenciesMojoIncludeRuntimeScope()
+        throws Exception
+    {
+        mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
+        mojo.project.setDependencyArtifacts( new HashSet() );
+        mojo.includeScope = "runtime";
+        mojo.execute();
+        ScopeArtifactFilter saf = new ScopeArtifactFilter( mojo.includeScope );
+
+        Iterator iter = mojo.project.getArtifacts().iterator();
+        while ( iter.hasNext() )
+        {
+            Artifact artifact = (Artifact) iter.next();
+            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
+            File file = new File( mojo.outputDirectory, fileName );
+
+            assertEquals( saf.include( artifact ), file.exists() );
+        }
+    }
+
+    public void testCopyDependenciesMojoIncludeprovidedScope()
+        throws Exception
+    {
+        mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
+        mojo.project.setDependencyArtifacts( new HashSet() );
+        mojo.includeScope = "provided";
+
+        mojo.execute();
+        Iterator iter = mojo.project.getArtifacts().iterator();
+        while ( iter.hasNext() )
+        {
+            Artifact artifact = (Artifact) iter.next();
+            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
+            File file = new File( mojo.outputDirectory, fileName );
+            assertEquals( Artifact.SCOPE_PROVIDED.equals( artifact.getScope() ), file.exists() );
+        }
+    }
+
+    public void testCopyDependenciesMojoIncludesystemScope()
+        throws Exception
+    {
+        mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
+        mojo.project.setDependencyArtifacts( new HashSet() );
+        mojo.includeScope = "system";
+
+        mojo.execute();
+
+        Iterator iter = mojo.project.getArtifacts().iterator();
+        while ( iter.hasNext() )
+        {
+            Artifact artifact = (Artifact) iter.next();
+            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
+            File file = new File( mojo.outputDirectory, fileName );
+
+            assertEquals( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ), file.exists() );
+        }
+    }
+
+}

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestResolveMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestResolveMojo.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestResolveMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestResolveMojo.java Mon Feb 12 19:28:20 2007
@@ -1,4 +1,5 @@
 package org.apache.maven.plugin.dependency;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo.java Mon Feb 12 19:28:20 2007
@@ -86,7 +86,7 @@
     public void assertUnpacked( boolean val, Artifact artifact )
     {
         File folder = DependencyUtil.getFormattedOutputDirectory( mojo.useSubDirectoryPerType,
-                                                                  mojo.useSubDirectoryPerArtifact,
+                                                                  mojo.useSubDirectoryPerArtifact, mojo.stripVersion,
                                                                   mojo.outputDirectory, artifact );
 
         File destFile = new File( folder, ArtifactStubFactory.getUnpackableFileName( artifact ) );
@@ -308,6 +308,39 @@
             assertUnpacked( artifact );
         }
     }
+    
+    public void testUnpackDependenciesMojoSubPerArtifactRemoveVersion()
+    throws Exception
+{
+    mojo.useSubDirectoryPerArtifact = true;
+    mojo.stripVersion = true;
+    mojo.execute();
+
+    Iterator iter = mojo.project.getArtifacts().iterator();
+    while ( iter.hasNext() )
+    {
+        Artifact artifact = (Artifact) iter.next();
+        assertUnpacked( artifact );
+    }
+}
+
+public void testUnpackDependenciesMojoSubPerArtifactAndTypeRemoveVersion()
+    throws Exception
+{
+    mojo.project.setArtifacts( stubFactory.getTypedArchiveArtifacts() );
+    mojo.project.setDependencyArtifacts( new HashSet() );
+    mojo.useSubDirectoryPerArtifact = true;
+    mojo.useSubDirectoryPerType = true;
+    mojo.stripVersion = true;
+    mojo.execute();
+
+    Iterator iter = mojo.project.getArtifacts().iterator();
+    while ( iter.hasNext() )
+    {
+        Artifact artifact = (Artifact) iter.next();
+        assertUnpacked( artifact );
+    }
+}
 
     public void testUnpackDependenciesMojoIncludeCompileScope()
         throws Exception
@@ -556,7 +589,7 @@
     public File getUnpackedFile( Artifact artifact )
     {
         File destDir = DependencyUtil.getFormattedOutputDirectory( mojo.isUseSubDirectoryPerType(), mojo
-            .isUseSubDirectoryPerArtifact(), mojo.getOutputDirectory(), artifact );
+            .isUseSubDirectoryPerArtifact(), mojo.stripVersion, mojo.getOutputDirectory(), artifact );
         File unpacked = new File( destDir, ArtifactStubFactory.getUnpackableFileName( artifact ) );
         assertTrue( unpacked.exists() );
         return unpacked;
@@ -724,4 +757,4 @@
             assertEquals( time, unpackedFile.lastModified() );
         }
     }
-}
\ No newline at end of file
+}

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestArtifactItem.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestArtifactItem.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestArtifactItem.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestArtifactItem.java Mon Feb 12 19:28:20 2007
@@ -1,4 +1,5 @@
 package org.apache.maven.plugin.dependency.fromConfiguration;
+
 /* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestCopyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestCopyMojo.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestCopyMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestCopyMojo.java Mon Feb 12 19:28:20 2007
@@ -65,8 +65,8 @@
         mojo.setFactory( DependencyTestUtils.getArtifactFactory() );
         mojo.setResolver( new StubArtifactResolver( stubFactory, false, false ) );
         mojo.setLocal( new StubArtifactRepository( this.testDir.getAbsolutePath() ) );
-        mojo.setArtifactCollector( new StubArtifactCollector());
-    
+        mojo.setArtifactCollector( new StubArtifactCollector() );
+
     }
 
     public ArtifactItem getSingleArtifactItem( boolean removeVersion )
@@ -163,7 +163,6 @@
 
         assertFilesExist( list, true );
     }
-
 
     public void testNonClassifierStrip()
         throws IOException, MojoExecutionException

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestUnpackMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestUnpackMojo.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestUnpackMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestUnpackMojo.java Mon Feb 12 19:28:20 2007
@@ -74,7 +74,7 @@
         mojo.setFactory( DependencyTestUtils.getArtifactFactory() );
         mojo.setResolver( new StubArtifactResolver( stubFactory, false, false ) );
         mojo.setLocal( new StubArtifactRepository( this.testDir.getAbsolutePath() ) );
-        mojo.setArtifactCollector( new StubArtifactCollector());
+        mojo.setArtifactCollector( new StubArtifactCollector() );
     }
 
     public ArtifactItem getSingleArtifactItem( boolean removeVersion )
@@ -502,19 +502,20 @@
         // round down to the last second
         long time = System.currentTimeMillis();
         time = time - ( time % 1000 );
-        //go back 10 more seconds for linux
-        time-=10000;
+        // go back 10 more seconds for linux
+        time -= 10000;
         // set to known value
         unpackedFile.setLastModified( time );
         // set source to be newer
         artifact.getFile().setLastModified( time + 4000 );
-        
-        //manually set markerfile (must match getMarkerFile in DefaultMarkerFileHandler)
+
+        // manually set markerfile (must match getMarkerFile in
+        // DefaultMarkerFileHandler)
         File marker = new File( mojo.getMarkersDirectory(), artifact.getId().replace( ':', '-' ) + ".marker" );
-        marker.setLastModified(time);
-        
+        marker.setLastModified( time );
+
         assertTrue( time == unpackedFile.lastModified() );
-        mojo.execute();  
+        mojo.execute();
         assertTrue( time != unpackedFile.lastModified() );
     }
 
@@ -547,8 +548,8 @@
     {
         File unpackedFile = new File( item.getOutputDirectory(), ArtifactStubFactory.getUnpackableFileName( item
             .getArtifact() ) );
-        
-        assertTrue(unpackedFile.exists());
+
+        assertTrue( unpackedFile.exists() );
         return unpackedFile;
 
     }

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/ArtifactStubFactory.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/ArtifactStubFactory.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/ArtifactStubFactory.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/ArtifactStubFactory.java Mon Feb 12 19:28:20 2007
@@ -90,8 +90,8 @@
                                    String type, String classifier, boolean optional )
         throws IOException
     {
-        ArtifactHandler ah = new DefaultArtifactHandlerStub(type,classifier);
-        
+        ArtifactHandler ah = new DefaultArtifactHandlerStub( type, classifier );
+
         Artifact artifact = new DefaultArtifact( groupId, artifactId, versionRange, scope, type, classifier, ah,
                                                  optional );
         if ( createFiles )

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/DependencyTestUtils.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/DependencyTestUtils.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/DependencyTestUtils.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/DependencyTestUtils.java Mon Feb 12 19:28:20 2007
@@ -1,4 +1,5 @@
 package org.apache.maven.plugin.dependency.testUtils;
+
 /* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -92,8 +93,9 @@
 
         field.set( object, value );
     }
-    
-    public static void setFileModifiedTime(File file) throws InterruptedException
+
+    public static void setFileModifiedTime( File file )
+        throws InterruptedException
     {
         Thread.sleep( 100 );
         // round down to the last second

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DependencyProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DependencyProjectStub.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DependencyProjectStub.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/DependencyProjectStub.java Mon Feb 12 19:28:20 2007
@@ -1,4 +1,5 @@
 package org.apache.maven.plugin.dependency.testUtils.stubs;
+
 /* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -90,9 +91,9 @@
 
     private List pluginArtifactRepositories;
 
-//    private ArtifactRepository releaseArtifactRepository;
+    // private ArtifactRepository releaseArtifactRepository;
 
- //   private ArtifactRepository snapshotArtifactRepository;
+    // private ArtifactRepository snapshotArtifactRepository;
 
     private List activeProfiles;
 
@@ -102,19 +103,19 @@
 
     private Artifact artifact;
 
-//    private Map artifactMap;
+    // private Map artifactMap;
 
     private Model originalModel;
 
- //   private Map pluginArtifactMap;
+    // private Map pluginArtifactMap;
 
- //   private Map reportArtifactMap;
+    // private Map reportArtifactMap;
 
- //   private Map extensionArtifactMap;
+    // private Map extensionArtifactMap;
 
- //   private Map projectReferences;
+    // private Map projectReferences;
 
- //   private Build buildOverlay;
+    // private Build buildOverlay;
 
     private boolean executionRoot;
 
@@ -183,14 +184,13 @@
 
     public Artifact getArtifact()
     {
-        if (artifact == null)
+        if ( artifact == null )
         {
-            ArtifactHandler ah = new DefaultArtifactHandlerStub("jar",null);
-            
+            ArtifactHandler ah = new DefaultArtifactHandlerStub( "jar", null );
+
             VersionRange vr = VersionRange.createFromVersion( "1.0" );
-            Artifact art = new DefaultArtifact( "group", "artifact", vr, Artifact.SCOPE_COMPILE, "jar", null, ah,
-                                                     false );
-            setArtifact(art);
+            Artifact art = new DefaultArtifact( "group", "artifact", vr, Artifact.SCOPE_COMPILE, "jar", null, ah, false );
+            setArtifact( art );
         }
         return artifact;
     }
@@ -418,32 +418,32 @@
 
     public void setArtifactMap( Map artifactMap )
     {
-    //    this.artifactMap = artifactMap;
+        // this.artifactMap = artifactMap;
     }
 
     public void setPluginArtifactMap( Map pluginArtifactMap )
     {
-        //this.pluginArtifactMap = pluginArtifactMap;
+        // this.pluginArtifactMap = pluginArtifactMap;
     }
 
     public void setReportArtifactMap( Map reportArtifactMap )
     {
-     //   this.reportArtifactMap = reportArtifactMap;
+        // this.reportArtifactMap = reportArtifactMap;
     }
 
     public void setExtensionArtifactMap( Map extensionArtifactMap )
     {
-       // this.extensionArtifactMap = extensionArtifactMap;
+        // this.extensionArtifactMap = extensionArtifactMap;
     }
 
     public void setProjectReferences( Map projectReferences )
     {
-        //this.projectReferences = projectReferences;
+        // this.projectReferences = projectReferences;
     }
 
     public void setBuildOverlay( Build buildOverlay )
     {
-        //this.buildOverlay = buildOverlay;
+        // this.buildOverlay = buildOverlay;
     }
 
     public void setCompileDependencies( List compileDependencies )
@@ -964,12 +964,12 @@
 
     public void setReleaseArtifactRepository( ArtifactRepository artifactRepository )
     {
-   //     this.releaseArtifactRepository = artifactRepository;
+        // this.releaseArtifactRepository = artifactRepository;
     }
 
     public void setSnapshotArtifactRepository( ArtifactRepository artifactRepository )
     {
-     //   this.snapshotArtifactRepository = artifactRepository;
+        // this.snapshotArtifactRepository = artifactRepository;
     }
 
     public void setOriginalModel( Model model )

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubArtifactCollector.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubArtifactCollector.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubArtifactCollector.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubArtifactCollector.java Mon Feb 12 19:28:20 2007
@@ -36,7 +36,7 @@
 
 /**
  * @author brianf
- *
+ * 
  */
 public class StubArtifactCollector
     implements ArtifactCollector
@@ -51,8 +51,16 @@
         // TODO Auto-generated constructor stub
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.maven.artifact.resolver.ArtifactCollector#collect(java.util.Set, org.apache.maven.artifact.Artifact, org.apache.maven.artifact.repository.ArtifactRepository, java.util.List, org.apache.maven.artifact.metadata.ArtifactMetadataSource, org.apache.maven.artifact.resolver.filter.ArtifactFilter, java.util.List)
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.maven.artifact.resolver.ArtifactCollector#collect(java.util.Set,
+     *      org.apache.maven.artifact.Artifact,
+     *      org.apache.maven.artifact.repository.ArtifactRepository,
+     *      java.util.List,
+     *      org.apache.maven.artifact.metadata.ArtifactMetadataSource,
+     *      org.apache.maven.artifact.resolver.filter.ArtifactFilter,
+     *      java.util.List)
      */
     public ArtifactResolutionResult collect( Set theArtifacts, Artifact theOriginatingArtifact,
                                             ArtifactRepository theLocalRepository, List theRemoteRepositories,
@@ -64,16 +72,24 @@
         ArtifactResolutionResult arr = new ArtifactResolutionResult();
 
         Iterator iter = theArtifacts.iterator();
-        while (iter.hasNext())
-        {  
-            nodes.add(new ResolutionNode((Artifact) iter.next(),theRemoteRepositories));
+        while ( iter.hasNext() )
+        {
+            nodes.add( new ResolutionNode( (Artifact) iter.next(), theRemoteRepositories ) );
         }
-        arr.setArtifactResolutionNodes(nodes);
+        arr.setArtifactResolutionNodes( nodes );
         return arr;
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.maven.artifact.resolver.ArtifactCollector#collect(java.util.Set, org.apache.maven.artifact.Artifact, java.util.Map, org.apache.maven.artifact.repository.ArtifactRepository, java.util.List, org.apache.maven.artifact.metadata.ArtifactMetadataSource, org.apache.maven.artifact.resolver.filter.ArtifactFilter, java.util.List)
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.maven.artifact.resolver.ArtifactCollector#collect(java.util.Set,
+     *      org.apache.maven.artifact.Artifact, java.util.Map,
+     *      org.apache.maven.artifact.repository.ArtifactRepository,
+     *      java.util.List,
+     *      org.apache.maven.artifact.metadata.ArtifactMetadataSource,
+     *      org.apache.maven.artifact.resolver.filter.ArtifactFilter,
+     *      java.util.List)
      */
     public ArtifactResolutionResult collect( Set theArtifacts, Artifact theOriginatingArtifact, Map theManagedVersions,
                                             ArtifactRepository theLocalRepository, List theRemoteRepositories,
@@ -85,11 +101,11 @@
         ArtifactResolutionResult arr = new ArtifactResolutionResult();
 
         Iterator iter = theArtifacts.iterator();
-        while (iter.hasNext())
-        {  
-            nodes.add(new ResolutionNode((Artifact) iter.next(),theRemoteRepositories));
+        while ( iter.hasNext() )
+        {
+            nodes.add( new ResolutionNode( (Artifact) iter.next(), theRemoteRepositories ) );
         }
-        arr.setArtifactResolutionNodes(nodes);
+        arr.setArtifactResolutionNodes( nodes );
         return arr;
     }
 

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubArtifactRepository.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubArtifactRepository.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubArtifactRepository.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubArtifactRepository.java Mon Feb 12 19:28:20 2007
@@ -1,4 +1,5 @@
 package org.apache.maven.plugin.dependency.testUtils.stubs;
+
 /* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubArtifactResolver.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubArtifactResolver.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubArtifactResolver.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubArtifactResolver.java Mon Feb 12 19:28:20 2007
@@ -1,4 +1,5 @@
 package org.apache.maven.plugin.dependency.testUtils.stubs;
+
 /* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubDefaultFileMarkerHandler.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubDefaultFileMarkerHandler.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubDefaultFileMarkerHandler.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubDefaultFileMarkerHandler.java Mon Feb 12 19:28:20 2007
@@ -1,4 +1,5 @@
 package org.apache.maven.plugin.dependency.testUtils.stubs;
+
 /* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubMarkerFile.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubMarkerFile.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubMarkerFile.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubMarkerFile.java Mon Feb 12 19:28:20 2007
@@ -1,4 +1,5 @@
 package org.apache.maven.plugin.dependency.testUtils.stubs;
+
 /* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubSourcesFileMarkerHandler.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubSourcesFileMarkerHandler.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubSourcesFileMarkerHandler.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/testUtils/stubs/StubSourcesFileMarkerHandler.java Mon Feb 12 19:28:20 2007
@@ -1,4 +1,5 @@
 package org.apache.maven.plugin.dependency.testUtils.stubs;
+
 /* 
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/TestDependencyStatusSets.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/TestDependencyStatusSets.java?view=diff&rev=506840&r1=506839&r2=506840
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/TestDependencyStatusSets.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/TestDependencyStatusSets.java Mon Feb 12 19:28:20 2007
@@ -1,4 +1,5 @@
 package org.apache.maven.plugin.dependency.utils;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -134,10 +135,10 @@
         dss = new DependencyStatusSets( artifacts, artifacts, artifacts );
         dss.logStatus( log, false );
         dss.logStatus( log, true );
-        dss.logStatus( log, false ,true);
-        dss.logStatus( log, true , true);
-        dss.logStatus( log, false , false);
-        dss.logStatus( log, true , false);
+        dss.logStatus( log, false, true );
+        dss.logStatus( log, true, true );
+        dss.logStatus( log, false, false );
+        dss.logStatus( log, true, false );
 
     }
 }