import java.nio.file.Files

File pomFile = new File(basedir, "generated-pom.xml");
separator = File.separator
File pomFileCopy = new File(basedir, '..' + separator + '..' + separator + '..' + separator + 'src' + separator + 'it' + separator + 'generate-javadocs-file' + separator + 'pom.xml');
System.err.println('pomFile file ' + pomFile.getAbsolutePath());
System.err.println('pomFile file exists ' + pomFile.exists());
System.err.println('pomFile file copy ' + pomFileCopy.getAbsolutePath());

assert pomFile.exists();
assert pomFileCopy.getParentFile().exists();
if (pomFileCopy.exists()) {
    pomFileCopy.delete();
}
Files.copy(pomFile.toPath(), pomFileCopy.toPath());

File logFile = new File(basedir, "build.log");
assert logFile.exists();
File logFileCopy = new File(logFile.getParentFile(), "generate-pom-file-" + logFile.getName())
if (logFileCopy.exists()) {
    logFileCopy.delete();
}
Files.copy(logFile.toPath(), logFileCopy.toPath());

return true;