in src/main/java/org/apache/maven/plugins/war/packaging/OverlayPackagingTask.java [52:83]
public void performPackaging(WarPackagingContext context) throws MojoExecutionException {
context.getLog()
.debug("OverlayPackagingTask performPackaging overlay.getTargetPath() " + overlay.getTargetPath());
if (overlay.shouldSkip()) {
context.getLog().info("Skipping overlay [" + overlay + "]");
} else {
try {
context.getLog().info("Processing overlay [" + overlay + "]");
// Step1: Extract if necessary
final File tmpDir = unpackOverlay(context, overlay);
// Step2: setup
final PathSet includes = getFilesToIncludes(tmpDir, overlay.getIncludes(), overlay.getExcludes());
// Copy
if (null == overlay.getTargetPath()) {
copyFiles(overlay.getId(), context, tmpDir, includes, overlay.isFiltered());
} else {
// overlay.getTargetPath() must ended with /
// if not we add it
String targetPath = overlay.getTargetPath();
if (!targetPath.endsWith("/")) {
targetPath = targetPath + "/";
}
copyFiles(overlay.getId(), context, tmpDir, includes, targetPath, overlay.isFiltered());
}
} catch (IOException e) {
throw new MojoExecutionException("Failed to copy file for overlay [" + overlay + "]", e);
}
}
}