in core-it-support/core-it-plugins/maven-it-plugin-context-passing/src/main/java/org/apache/maven/plugin/coreit/CatchMojo.java [52:79]
public void execute() throws MojoExecutionException {
String value = (String) getPluginContext().get(ThrowMojo.THROWN_PARAMETER);
if (!outDir.exists()) {
outDir.mkdirs();
}
File outfile = new File(outDir, value);
Writer writer = null;
try {
writer = new FileWriter(outfile);
writer.write(value);
writer.flush();
} catch (IOException e) {
throw new MojoExecutionException("Cannot write output file: " + outfile, e);
} finally {
if (writer != null) {
try {
writer.close();
} catch (IOException e) {
// ignore
}
}
}
}