Skip to content

Commit

Permalink
Merge remote-tracking branch 'hd42/master' (Update to jbake 2.6.3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascheman committed Oct 5, 2019
2 parents 645e0ab + 1b4df42 commit 66195e7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<prerequisites>
<maven>3.1.1</maven>
</prerequisites>

<name>jbake-maven-plugin</name>
<description>jbake-maven-plugin is a Maven plugin allowing you to integrate JBake into your projects build</description>
<url>http://jbake.org</url>
Expand Down Expand Up @@ -111,7 +111,7 @@
<dependency>
<groupId>org.jbake</groupId>
<artifactId>jbake-core</artifactId>
<version>2.6.2</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 Expand Up @@ -252,4 +252,4 @@
</plugin>
</plugins>
</reporting>
</project>
</project>
22 changes: 6 additions & 16 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 @@ -29,9 +28,9 @@
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
import org.jbake.app.Oven;
import org.jbake.app.configuration.ConfigUtil;
import org.jbake.app.configuration.DefaultJBakeConfiguration;
import org.jbake.app.configuration.JBakeConfiguration;
import org.jbake.app.configuration.JBakeConfigurationFactory;

import java.io.File;

Expand Down Expand Up @@ -98,8 +97,6 @@ protected void reRender() throws MojoExecutionException, MojoFailureException {
// TODO: At some point, reuse Oven
Oven oven = new Oven(createConfiguration());

oven.setupPaths();

oven.bake();
if (failOnError && !oven.getErrors().isEmpty()) {
throw new MojoFailureException("Baked with " + oven.getErrors().size() + " errors. Check output above for details!");
Expand All @@ -112,18 +109,11 @@ protected void reRender() throws MojoExecutionException, MojoFailureException {
}

protected JBakeConfiguration createConfiguration() throws ConfigurationException {
JBakeConfigurationFactory jbakeConfigurationFactory = new JBakeConfigurationFactory();

// load base config (cast to DefaultJBakeConfig)
DefaultJBakeConfiguration baseConfiguration = (DefaultJBakeConfiguration)jbakeConfigurationFactory.getConfigUtil().loadConfig(inputDirectory);

final CompositeConfiguration config = new CompositeConfiguration();

config.addConfiguration(baseConfiguration.getCompositeConfiguration());

config.addConfiguration(new MapConfiguration(this.project.getProperties()));

return jbakeConfigurationFactory.createDefaultJbakeConfiguration(inputDirectory, outputDirectory, config, isClearCache);
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 66195e7

Please sign in to comment.