boolean ignoreDelta =
!outputExists || buildContext.hasDelta( mavenResourcesExecution.getFileFilters() )
|| buildContext.hasDelta( getRelativeOutputDirectory( mavenResourcesExecution ) );
getLogger().debug( "ignoreDelta " + ignoreDelta );
Scanner scanner = buildContext.newScanner( resourceDirectory, ignoreDelta );
setupScanner( resource, scanner );
scanner.scan();
if ( mavenResourcesExecution.isIncludeEmptyDirs() )
{
try
{
File targetDirectory = targetPath == null ? outputDirectory
: new File( outputDirectory, targetPath );
copyDirectoryLayout( resourceDirectory, targetDirectory, scanner );
}
catch ( IOException e )
{
throw new MavenFilteringException( "Cannot copy directory structure from "
+ resourceDirectory.getPath() + " to " + outputDirectory.getPath() );
}
}
List includedFiles = Arrays.asList( scanner.getIncludedFiles() );
getLogger().info(
"Copying " + includedFiles.size() + " resource" + ( includedFiles.size() > 1 ? "s" : "" )
+ ( targetPath == null ? "" : " to " + targetPath ) );
for ( Iterator j = includedFiles.iterator(); j.hasNext(); )
{
String name = (String) j.next();
File source = new File( resourceDirectory, name );
//File destinationFile = new File( outputDirectory, destination );
File destinationFile = getDestinationFile( outputDirectory, targetPath, name );
boolean filteredExt = filteredFileExtension( source.getName(), mavenResourcesExecution
.getNonFilteredFileExtensions() );
mavenFileFilter.copyFile( source, destinationFile, resource.isFiltering() && filteredExt,
mavenResourcesExecution.getFilterWrappers(), mavenResourcesExecution
.getEncoding(), mavenResourcesExecution.isOverwrite() );
}
// deal with deleted source files
scanner = buildContext.newDeleteScanner( resourceDirectory );
setupScanner( resource, scanner );
scanner.scan();
List deletedFiles = Arrays.asList( scanner.getIncludedFiles() );
for ( Iterator j = deletedFiles.iterator(); j.hasNext(); )
{
String name = (String) j.next();