Skip to content

Commit

Permalink
Update to JBake 2.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
hd42 committed Nov 13, 2018
1 parent 8ecf3d3 commit 1b4df42
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<dependency>
<groupId>org.jbake</groupId>
<artifactId>jbake-core</artifactId>
<version>2.6.1</version>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
Expand Down Expand Up @@ -178,7 +178,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.4</version>
<version>3.6.0</version>
<configuration>
<goalPrefix>jbake</goalPrefix>
<requirements>
Expand Down
24 changes: 10 additions & 14 deletions src/main/java/org/jbake/maven/GenerateMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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) {
Expand All @@ -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;
}

}

0 comments on commit 1b4df42

Please sign in to comment.