You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ag...@apache.org on 2015/03/24 09:13:55 UTC
svn commit: r1668820 - in /maven/plugins/trunk/maven-eclipse-plugin/src/test:
java/org/apache/maven/plugin/eclipse/it/AbstractEclipsePluginIT.java
resources/projects/project-10/pom.xml
Author: agudian
Date: Tue Mar 24 08:13:55 2015
New Revision: 1668820
URL: http://svn.apache.org/r1668820
Log:
o Ignore .svn subdirectories with old SVN-WC format when comparing directories
Modified:
maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/AbstractEclipsePluginIT.java
maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-10/pom.xml
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/AbstractEclipsePluginIT.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/AbstractEclipsePluginIT.java?rev=1668820&r1=1668819&r2=1668820&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/AbstractEclipsePluginIT.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/eclipse/it/AbstractEclipsePluginIT.java Tue Mar 24 08:13:55 2015
@@ -26,7 +26,10 @@ import java.io.StringReader;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -124,6 +127,8 @@ public abstract class AbstractEclipsePlu
*/
private static final String CLASSPATH_FILENAME = ".classpath";
+ private static final Collection<String> IGNORED_DIRS = new HashSet<String>( Arrays.asList( ".svn" ) );
+
private File mavenHome;
/**
@@ -530,7 +535,7 @@ public abstract class AbstractEclipsePlu
protected void compareDirectoryContent( File basedir, File projectOutputDir )
throws MojoExecutionException
{
- File[] expectedDirectories = getExpectedDirectories( basedir );
+ Collection<File> expectedDirectories = getExpectedDirectories( basedir );
for (File expectedDirectory : expectedDirectories) {
File[] expectedFilesToCompare = getExpectedFilesToCompare(expectedDirectory);
@@ -783,10 +788,14 @@ public abstract class AbstractEclipsePlu
* @param basedir base directory to search for directories named "expected"
* @return an array of directories that match "expected"
*/
- private File[] getExpectedDirectories( File basedir )
+ private Collection<File> getExpectedDirectories( File basedir )
{
- List expectedDirectories = new ArrayList();
- List subdirectories = new ArrayList();
+ if (IGNORED_DIRS.contains( basedir.getName() ) ) {
+ return Collections.emptyList();
+ }
+
+ List<File> expectedDirectories = new ArrayList<File>();
+ List<File> subdirectories = new ArrayList<File>();
File[] allFiles = basedir.listFiles();
if ( allFiles != null )
@@ -803,13 +812,12 @@ public abstract class AbstractEclipsePlu
}
if ( !subdirectories.isEmpty() )
{
- for (Object subdirectory1 : subdirectories) {
- File subdirectory = (File) subdirectory1;
- File[] subdirectoryFiles = getExpectedDirectories(subdirectory);
- expectedDirectories.addAll(Arrays.asList(subdirectoryFiles));
+ for (File subdirectory : subdirectories) {
+ Collection<File> subdirectoryFiles = getExpectedDirectories(subdirectory);
+ expectedDirectories.addAll(subdirectoryFiles);
}
}
- return (File[]) expectedDirectories.toArray( new File[expectedDirectories.size()] );
+ return expectedDirectories;
}
/**
Modified: maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-10/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-10/pom.xml?rev=1668820&r1=1668819&r2=1668820&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-10/pom.xml (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/project-10/pom.xml Tue Mar 24 08:13:55 2015
@@ -50,7 +50,7 @@ under the License.
<configuration>
<workspace>${basedir}/../../eclipse/workspaceDoesNotExist</workspace>
<wtpversion>R7</wtpversion>
- <downloadJavadoc>true</downloadJavadoc>
+ <downloadJavadocs>true</downloadJavadocs>
<projectnatures>
<projectnature>org.eclipse.jdt.core.javanature</projectnature>
</projectnatures>