Skip to content

Commit

Permalink
Switch to ClassLoader template loading (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejritter authored Jun 16, 2021
1 parent 71a4632 commit 59e44bd
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,8 @@ public HtmlReportHandler(final Path outputDir) {

// Setup FreeMarker template
this.config = new Configuration(VERSION_2_3_30);
try {
this.outputDir.mkdirs();
config.setDirectoryForTemplateLoading(new File("src/main/resources/templates"));
} catch (IOException e) {
throw new RuntimeException(e);
}
this.outputDir.mkdirs();
config.setClassLoaderForTemplateLoading(this.getClass().getClassLoader(), "/templates");

// These configuration items are set per the FreeMarker guidance:
// https://freemarker.apache.org/docs/pgui_quickstart_createconfiguration.html
Expand Down

0 comments on commit 59e44bd

Please sign in to comment.