PR: MNG-962

unify defaults excludes

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@312503 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-10-09 22:09:21 +00:00
parent 6d8a905947
commit 3510e98e3f
9 changed files with 35 additions and 101 deletions

View File

@ -80,10 +80,7 @@ public class Repository
else if ( LAYOUT_DEFAULT.equals( layout ) )
{
repositoryPath = dependency.getGroupId().replace( '.', '/' );
// if ( !dependency.getType().equals( "pom" ) )
// {
repositoryPath = repositoryPath + "/" + dependency.getArtifactId() + "/" + dependency.getVersion();
// }
repositoryPath = repositoryPath + "/" + dependency.getArtifact();
}
else

View File

@ -2,7 +2,7 @@
<parent>
<artifactId>maven-plugin-parent</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>2.0-beta-3</version>
<version>2.0-beta-4-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-assembly-plugin</artifactId>
@ -49,15 +49,25 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>1.0-alpha-3-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>plexus</groupId>
<artifactId>plexus-utils</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>2.0-beta-1</version>
<version>2.0-beta-4-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

View File

@ -50,7 +50,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
@ -304,8 +303,7 @@ public class AssemblyMojo
"Unable to obtain unarchiver for file '" + artifact.getFile() + "'" );
}
}
archiver.addDirectory( tempLocation, null,
(String[]) getDefaultExcludes().toArray( EMPTY_STRING_ARRAY ) );
archiver.addDirectory( tempLocation, null, FileUtils.getDefaultExcludes() );
}
else
{
@ -378,7 +376,7 @@ public class AssemblyMojo
// TODO: default excludes should be in the archiver?
List excludesList = fileSet.getExcludes();
excludesList.addAll( getDefaultExcludes() );
excludesList.addAll( FileUtils.getDefaultExcludesAsList() );
String[] excludes = (String[]) excludesList.toArray( EMPTY_STRING_ARRAY );
File archiveBaseDir = new File( directory );
@ -530,42 +528,6 @@ public class AssemblyMojo
return archiver;
}
/**
* Insert into the exclude list the default excludes file pattern.
*
* @return defaultExcludes List containing the default patterns of files to be excluded.
*/
public static List getDefaultExcludes()
{
List defaultExcludes = new ArrayList();
defaultExcludes.add( "**/*~" );
defaultExcludes.add( "**/#*#" );
defaultExcludes.add( "**/.#*" );
defaultExcludes.add( "**/%*%" );
defaultExcludes.add( "**/._*" );
// CVS
defaultExcludes.add( "**/CVS" );
defaultExcludes.add( "**/CVS/**" );
defaultExcludes.add( "**/.cvsignore" );
// SCCS
defaultExcludes.add( "**/SCCS" );
defaultExcludes.add( "**/SCCS/**" );
// Visual SourceSafe
defaultExcludes.add( "**/vssver.scc" );
// Subversion
defaultExcludes.add( "**/.svn" );
defaultExcludes.add( "**/.svn/**" );
// Mac
defaultExcludes.add( "**/.DS_Store" );
return defaultExcludes;
}
private void copyReplacingLineEndings( File source, File dest, String lineEndings )
throws IOException
{

View File

@ -2,7 +2,7 @@
<parent>
<artifactId>maven-plugin-parent</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>2.0-beta-3</version>
<version>2.0-beta-4-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-checkstyle-plugin</artifactId>
@ -54,7 +54,7 @@
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
<version>2.0-beta-1</version>
<version>2.0-beta-4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>antlr</groupId>
@ -66,5 +66,9 @@
<artifactId>checkstyle-optional</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -369,14 +369,15 @@ public class CheckstyleReport
excludesStr.append( excludes );
}
for ( int i = 0; i < DEFAULT_EXCLUDES.length; i++ )
String[] defaultExcludes = FileUtils.getDefaultExcludes();
for ( int i = 0; i < defaultExcludes.length; i++ )
{
if ( excludesStr.length() > 0 )
{
excludesStr.append( "," );
}
excludesStr.append( DEFAULT_EXCLUDES[i] );
excludesStr.append( defaultExcludes[i] );
}
List files;

View File

@ -2,7 +2,7 @@
<parent>
<artifactId>maven-plugin-parent</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>2.0-beta-1</version>
<version>2.0-beta-4-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-pmd-plugin</artifactId>
@ -24,12 +24,16 @@
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
<version>2.0-beta-1</version>
<version>2.0-beta-4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>saxpath</groupId>
<artifactId>saxpath</artifactId>
<version>1.0-FCS</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
</dependencies>
</project>
</project>

View File

@ -247,13 +247,14 @@ public class PmdReport
{
excludesStr.append( excludes );
}
for ( int i = 0; i < DEFAULT_EXCLUDES.length; i++ )
String[] defaultExcludes = FileUtils.getDefaultExcludes();
for ( int i = 0; i < defaultExcludes.length; i++ )
{
if ( excludesStr.length() > 0 )
{
excludesStr.append( "," );
}
excludesStr.append( DEFAULT_EXCLUDES[i] );
excludesStr.append( defaultExcludes[i] );
}
return FileUtils.getFiles( dir, includes, excludesStr.toString() );

View File

@ -68,32 +68,6 @@ public class SiteMojo
private static final String DEFAULT_TEMPLATE = RESOURCE_DIR + "/maven-site.vm";
/**
* Patterns which should be excluded by default.
*/
// TODO Push me into a shared area (plexus-utils?)
private static final String[] DEFAULT_EXCLUDES = new String[]{
// Miscellaneous typical temporary files
"**/*~", "**/#*#", "**/.#*", "**/%*%", "**/._*",
// CVS
"**/CVS", "**/CVS/**", "**/.cvsignore",
// SCCS
"**/SCCS", "**/SCCS/**",
// Visual SourceSafe
"**/vssver.scc",
// Subversion
"**/.svn", "**/.svn/**",
// Arch/Bazaar
"**/.arch-ids", "**/.arch-ids/**",
// Mac
"**/.DS_Store"};
/**
* Directory containing source for apt, fml and xdoc docs.
*
@ -294,7 +268,7 @@ public class SiteMojo
// Try to find duplicate files
Map duplicate = new LinkedHashMap();
String defaultExcludes = StringUtils.join( DEFAULT_EXCLUDES, "," );
String defaultExcludes = StringUtils.join( FileUtils.getDefaultExcludes(), "," );
if ( siteDirectoryFile.exists() )
{

View File

@ -25,6 +25,7 @@ import org.codehaus.doxia.site.renderer.SiteRenderer;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.StringInputStream;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.FileUtils;
import java.io.File;
import java.io.IOException;
@ -43,26 +44,6 @@ public abstract class AbstractMavenReport
extends AbstractMojo
implements MavenReport
{
/**
* @todo share, use default excludes from plexus utils.
*/
protected static final String[] DEFAULT_EXCLUDES = {// Miscellaneous typical temporary files
"**/*~", "**/#*#", "**/.#*", "**/%*%", "**/._*",
// CVS
"**/CVS", "**/CVS/**", "**/.cvsignore",
// SCCS
"**/SCCS", "**/SCCS/**",
// Visual SourceSafe
"**/vssver.scc",
// Subversion
"**/.svn", "**/.svn/**",
// Mac
"**/.DS_Store"};
private Sink sink;