code: public static void copyFileToDir(File file, File rel, File dir, AbstractWisdomMojo mojo, MavenResourcesFiltering
              filtering, Properties additionalProperties) throws
              IOException {
          if (filtering == null) {
              File out = computeRelativeFile(file, rel, dir);
              if (out.getParentFile() != null) {
                  mojo.getLog().debug("Creating " + out.getParentFile() + " : " + out.getParentFile().mkdirs());
                  FileUtils.copyFileToDirectory(file, out.getParentFile());
              } else {
                  throw new IOException("Cannot copy file - parent directory not accessible for "
                          + file.getAbsolutePath());
              }
          } else {
              Resource resource = new Resource();
              resource.setDirectory(rel.getAbsolutePath());
              resource.setFiltering(true);
              resource.setTargetPath(dir.getAbsolutePath());
              resource.setIncludes(ImmutableList.of("**/" + file.getName()));
  
              List<String> excludedExtensions = new ArrayList<>();
              excludedExtensions.addAll(filtering.getDefaultNonFilteredFileExtensions());
              excludedExtensions.addAll(NON_FILTERED_EXTENSIONS);
  
              MavenResourcesExecution exec = new MavenResourcesExecution(ImmutableList.of(resource), dir, mojo.project,
                      "UTF-8", Collections.<String>emptyList(), excludedExtensions, mojo.session);
  
              if (additionalProperties != null) {
                  exec.setAdditionalProperties(additionalProperties);
              }
              exec.setEscapeString("\\");
  
              try {
                  filtering.filterResources(exec);
              } catch (MavenFilteringException e) {
                  throw new IOException("Error while copying resources", e);
              }
          }
      }
docs: Copies the file <tt>file</tt> to the directory <tt>dir</tt>, keeping the structure relative to <tt>rel</tt>.
  
  @param file                 the file to copy
  @param rel                  the base 'relative'
  @param dir                  the directory
  @param mojo                 the mojo
  @param filtering            the filtering component
  @param additionalProperties additional properties
  @throws IOException if the file cannot be copied.