in tomee-patch-plugin/src/main/java/org/apache/tomee/patch/plugin/PatchMojo.java [375:403]
private void prepareResources() throws MojoExecutionException {
final File defaultPatchResources = new File(basedir, "src/patch/resources");
Files.mkdir(patchResourceDirectory);
for (final File patchResource : patchResources) {
if (patchResource == null) continue;
if (!patchResource.exists()) {
if (patchResource.getAbsolutePath().equals(defaultPatchResources.getAbsolutePath())) {
// If the default directory does not exist, the user likely did not explicitly
// ask for it. Just silently skip it.
continue;
}
final String message = "Patch resource directory does not exist: " + patchResource.getAbsolutePath();
getLog().error(message);
throw new MojoExecutionException(message);
}
if (!patchResource.isDirectory()) {
final String message = "Patch resource directory is not a directory: " + patchResource.getAbsolutePath();
getLog().error(message);
throw new MojoExecutionException(message);
}
}
patchResources.stream()
.filter(Objects::nonNull)
.filter(File::exists)
.forEach(file -> copy(file, file, patchResourceDirectory));
}