Author: brett
Date: Sat Jul 30 06:00:55 2005
New Revision: 226507

URL: http://svn.apache.org/viewcvs?rev=226507&view=rev
Log:
- disable parent copying for now, it's broken (infinite loop)
- fix detection of files to correct two bugs: site.xml was incorrectly detected 
as a dupe of site.apt and identical filenames in different paths were 
incorrectly marked as dupes

Modified:
    
maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java

Modified: 
maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java
URL: 
http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java?rev=226507&r1=226506&r2=226507&view=diff
==============================================================================
--- 
maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java
 (original)
+++ 
maven/components/trunk/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java
 Sat Jul 30 06:00:55 2005
@@ -52,11 +52,13 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Set;
 import java.util.StringTokenizer;
 
 /**
@@ -367,9 +369,9 @@
                     for ( Iterator it = duplicate.entrySet().iterator(); 
it.hasNext(); )
                     {
                         Map.Entry entry = (Map.Entry) it.next();
-                        List values = (List) entry.getValue();
+                        Set values = (Set) entry.getValue();
 
-                        if ( values != null && values.size() > 1 )
+                        if ( values.size() > 1 )
                         {
                             if ( sb == null )
                             {
@@ -454,6 +456,9 @@
                     MavenProject parentProject = project.getParent();
                     if ( parentProject != null )
                     {
+/* Not working: 1) parentProject.getBasedir() returns the current basedir for 
some reason, so it copies inside itself
+which loops forever, and 2) this might be better working as a top-level 
aggregation rather than pushing from the
+subprojects...
                         // TODO Handle user plugin configuration
                         File parentSiteDir = new File( 
parentProject.getBasedir(),
                                                        
parentProject.getBuild().getDirectory() + File.separator +
@@ -466,6 +471,7 @@
 
                         File siteDir = new File( outputDirectory );
                         FileUtils.copyDirectoryStructure( siteDir, 
parentSiteDir );
+*/
                     }
                 }
             }
@@ -1056,11 +1062,6 @@
     private static void tryToFindDuplicates( File directory, Map duplicate )
         throws IOException
     {
-        if ( duplicate == null )
-        {
-            duplicate = new HashMap();
-        }
-
         String defaultExcludes = StringUtils.join( DEFAULT_EXCLUDES, "," );
         List siteFiles = FileUtils.getFileNames( directory, null, 
defaultExcludes, false );
         for ( Iterator it = siteFiles.iterator(); it.hasNext(); )
@@ -1082,22 +1083,13 @@
             String key = currentFile.substring( currentFile.indexOf( 
File.separator ) + 1,
                                                 currentFile.lastIndexOf( "." ) 
);
 
-            String filePattern = "**/" + key + ".*";
-
-            List files = FileUtils.getFileNames( directory, filePattern, 
defaultExcludes, true );
-            if ( files != null && files.size() > 0 )
+            Set tmp = (Set) duplicate.get( key.toLowerCase() );
+            if ( tmp == null )
             {
-                List tmp = (List) duplicate.get( key.toLowerCase() );
-                if ( tmp == null )
-                {
-                    tmp = new ArrayList();
-                }
-                if ( !tmp.containsAll( files ) )
-                {
-                    tmp.addAll( files );
-                }
+                tmp = new HashSet();
                 duplicate.put( key.toLowerCase(), tmp );
             }
+            tmp.add( key );
         }
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to