mirror of https://github.com/apache/maven.git
- 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 git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@226507 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
88333380a9
commit
e255dee1c9
|
@ -52,11 +52,13 @@ import java.net.URLClassLoader;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -367,9 +369,9 @@ public class DoxiaMojo
|
||||||
for ( Iterator it = duplicate.entrySet().iterator(); it.hasNext(); )
|
for ( Iterator it = duplicate.entrySet().iterator(); it.hasNext(); )
|
||||||
{
|
{
|
||||||
Map.Entry entry = (Map.Entry) it.next();
|
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 )
|
if ( sb == null )
|
||||||
{
|
{
|
||||||
|
@ -454,6 +456,9 @@ public class DoxiaMojo
|
||||||
MavenProject parentProject = project.getParent();
|
MavenProject parentProject = project.getParent();
|
||||||
if ( parentProject != null )
|
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
|
// TODO Handle user plugin configuration
|
||||||
File parentSiteDir = new File( parentProject.getBasedir(),
|
File parentSiteDir = new File( parentProject.getBasedir(),
|
||||||
parentProject.getBuild().getDirectory() + File.separator +
|
parentProject.getBuild().getDirectory() + File.separator +
|
||||||
|
@ -466,6 +471,7 @@ public class DoxiaMojo
|
||||||
|
|
||||||
File siteDir = new File( outputDirectory );
|
File siteDir = new File( outputDirectory );
|
||||||
FileUtils.copyDirectoryStructure( siteDir, parentSiteDir );
|
FileUtils.copyDirectoryStructure( siteDir, parentSiteDir );
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1056,11 +1062,6 @@ public class DoxiaMojo
|
||||||
private static void tryToFindDuplicates( File directory, Map duplicate )
|
private static void tryToFindDuplicates( File directory, Map duplicate )
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
if ( duplicate == null )
|
|
||||||
{
|
|
||||||
duplicate = new HashMap();
|
|
||||||
}
|
|
||||||
|
|
||||||
String defaultExcludes = StringUtils.join( DEFAULT_EXCLUDES, "," );
|
String defaultExcludes = StringUtils.join( DEFAULT_EXCLUDES, "," );
|
||||||
List siteFiles = FileUtils.getFileNames( directory, null, defaultExcludes, false );
|
List siteFiles = FileUtils.getFileNames( directory, null, defaultExcludes, false );
|
||||||
for ( Iterator it = siteFiles.iterator(); it.hasNext(); )
|
for ( Iterator it = siteFiles.iterator(); it.hasNext(); )
|
||||||
|
@ -1082,22 +1083,13 @@ public class DoxiaMojo
|
||||||
String key = currentFile.substring( currentFile.indexOf( File.separator ) + 1,
|
String key = currentFile.substring( currentFile.indexOf( File.separator ) + 1,
|
||||||
currentFile.lastIndexOf( "." ) );
|
currentFile.lastIndexOf( "." ) );
|
||||||
|
|
||||||
String filePattern = "**/" + key + ".*";
|
Set tmp = (Set) duplicate.get( key.toLowerCase() );
|
||||||
|
|
||||||
List files = FileUtils.getFileNames( directory, filePattern, defaultExcludes, true );
|
|
||||||
if ( files != null && files.size() > 0 )
|
|
||||||
{
|
|
||||||
List tmp = (List) duplicate.get( key.toLowerCase() );
|
|
||||||
if ( tmp == null )
|
if ( tmp == null )
|
||||||
{
|
{
|
||||||
tmp = new ArrayList();
|
tmp = new HashSet();
|
||||||
}
|
|
||||||
if ( !tmp.containsAll( files ) )
|
|
||||||
{
|
|
||||||
tmp.addAll( files );
|
|
||||||
}
|
|
||||||
duplicate.put( key.toLowerCase(), tmp );
|
duplicate.put( key.toLowerCase(), tmp );
|
||||||
}
|
}
|
||||||
|
tmp.add( key );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue