code: private List<String> copyResources(File targetDirectory, List<FileSet> fileSets) throws MojoExecutionException {
          ArrayList<String> addedFiles = new ArrayList<String>();
          for (FileSet fileSet : fileSets) {
              // Get the absolute base directory for the FileSet
              File sourceDirectory = new File(fileSet.getDirectory());
  
              if (!sourceDirectory.isAbsolute()) {
                  sourceDirectory = new File(project.getBasedir(), sourceDirectory.getPath());
              }
  
              if (!sourceDirectory.exists()) {
                  // If the requested directory does not exist, log it and carry on
                  getLog().warn("Specified source directory " + sourceDirectory.getPath() + " does not exist.");
                  continue;
              }
  
              List<String> includedFiles = scanFileSet(sourceDirectory, fileSet);
              addedFiles.addAll(includedFiles);
  
              getLog().info("Copying " + includedFiles.size() + " additional resource" + (includedFiles.size() > 1 ? "s" : ""));
  
              for (String destination : includedFiles) {
                  File source = new File(sourceDirectory, destination);
                  File destinationFile = new File(targetDirectory, destination);
  
                  // Make sure that the directory we are copying into exists
                  destinationFile.getParentFile().mkdirs();
  
                  try {
                      FileUtils.copyFile(source, destinationFile);
                      destinationFile.setExecutable(fileSet.isExecutable(),false);
  
                  } catch (IOException e) {
                      throw new MojoExecutionException("Error copying additional resource " + source, e);
                  }
              }
          }
          return addedFiles;
      }
docs: Copies given resources to the build directory.
  
  @param fileSets A list of FileSet objects that represent additional
  resources to copy.
  @throws MojoExecutionException In case of a resource copying error.