From 1b4df424bf08d98e85eab0c3f6e7e29a5832b07c Mon Sep 17 00:00:00 2001 From: Daniel Schwering Date: Tue, 13 Nov 2018 12:39:55 +0100 Subject: [PATCH] Update to JBake 2.6.3 --- pom.xml | 4 ++-- .../java/org/jbake/maven/GenerateMojo.java | 24 ++++++++----------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/pom.xml b/pom.xml index 5ad9207f..5b169121 100644 --- a/pom.xml +++ b/pom.xml @@ -111,7 +111,7 @@ org.jbake jbake-core - 2.6.1 + 2.6.3 org.apache.maven @@ -178,7 +178,7 @@ org.apache.maven.plugins maven-plugin-plugin - 3.4 + 3.6.0 jbake diff --git a/src/main/java/org/jbake/maven/GenerateMojo.java b/src/main/java/org/jbake/maven/GenerateMojo.java index 957a0f44..90ee7ba0 100644 --- a/src/main/java/org/jbake/maven/GenerateMojo.java +++ b/src/main/java/org/jbake/maven/GenerateMojo.java @@ -18,7 +18,6 @@ import com.orientechnologies.orient.core.Orient; -import org.apache.commons.configuration.CompositeConfiguration; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.MapConfiguration; import org.apache.maven.plugin.AbstractMojo; @@ -27,9 +26,10 @@ import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.project.MavenProject; -import org.jbake.app.ConfigUtil; -import org.jbake.app.JBakeException; import org.jbake.app.Oven; +import org.jbake.app.configuration.ConfigUtil; +import org.jbake.app.configuration.DefaultJBakeConfiguration; +import org.jbake.app.configuration.JBakeConfiguration; import java.io.File; @@ -88,9 +88,7 @@ protected void reRender() throws MojoExecutionException { Orient.instance().startup(); // TODO: At some point, reuse Oven - Oven oven = new Oven(inputDirectory, outputDirectory, createConfiguration(), isClearCache); - - oven.setupPaths(); + Oven oven = new Oven(createConfiguration()); oven.bake(); } catch (Exception e) { @@ -100,14 +98,12 @@ protected void reRender() throws MojoExecutionException { } } - protected CompositeConfiguration createConfiguration() throws ConfigurationException { - final CompositeConfiguration config = new CompositeConfiguration(); - - config.addConfiguration(ConfigUtil.load(inputDirectory)); - - config.addConfiguration(new MapConfiguration(this.project.getProperties())); - - return config; + protected JBakeConfiguration createConfiguration() throws ConfigurationException { + DefaultJBakeConfiguration jBakeConfiguration = (DefaultJBakeConfiguration) new ConfigUtil().loadConfig(inputDirectory); + jBakeConfiguration.getCompositeConfiguration().addConfiguration(new MapConfiguration(this.project.getProperties())); + jBakeConfiguration.setDestinationFolder(outputDirectory); + jBakeConfiguration.setClearCache(isClearCache); + return jBakeConfiguration; } }