code: protected void copyResources( List<Resource> resources, String outputDirectory ) throws MojoExecutionException
      {
          initializeFiltering();
  
          if ( encoding == null || encoding.length() < 1 )
          {
              getLog().info( "Using default encoding to copy filtered resources." );
          }
          else
          {
              getLog().info( "Using encoding: \'" + encoding + "\' to copy filtered resources." );
          }
  
          for ( Resource resource:  resources )
          {
  
              String targetPath = resource.getTargetPath();
  
              File resourceDirectory = new File( resource.getDirectory() );
  
              if ( !resourceDirectory.exists() )
              {
                  continue;
              }
  
              DirectoryScanner scanner = new DirectoryScanner();
  
              scanner.setBasedir( resource.getDirectory() );
              if ( resource.getIncludes() != null && !resource.getIncludes().isEmpty() )
              {
                  scanner.setIncludes( (String[]) resource.getIncludes().toArray( EMPTY_STRING_ARRAY ) );
              }
              else
              {
                  scanner.setIncludes( DEFAULT_INCLUDES );
              }
              if ( resource.getExcludes() != null && !resource.getExcludes().isEmpty() )
              {
                  scanner.setExcludes( (String[]) resource.getExcludes().toArray( EMPTY_STRING_ARRAY ) );
              }
  
              scanner.addDefaultExcludes();
              scanner.scan();
  
              List<String> includedFiles = Arrays.asList( scanner.getIncludedFiles() );
              for ( String name: includedFiles )
              {
  
                  String destination = name;
  
                  if ( targetPath != null )
                  {
                      destination = targetPath + "/" + name;
                  }
  
                  File source = new File( resource.getDirectory(), name );
  
                  File destinationFile = new File( outputDirectory, destination );
  
                  if ( !destinationFile.getParentFile().exists() )
                  {
                      destinationFile.getParentFile().mkdirs();
                  }
  
                  try
                  {
                      copyFile( source, destinationFile, resource.isFiltering() );
                  }
                  catch ( IOException e )
                  {
                      throw new MojoExecutionException( "Error copying resources", e );
                  }
              }
          }
      }
docs: <p>copyResources.</p>
  
  @param resources a {@link java.util.List} object.
  @param outputDirectory a {@link java.lang.String} object.
  @throws org.apache.maven.plugin.MojoExecutionException if any.