Maven plugin for baking and serving sites with JBake and Jetty.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/main/java/de/bildschirmarbeiter/jbake/maven/plugin
LICENSE.txt
README.md
pom.xml

README.md

JBake Maven Plugin

Maven plugin for baking and serving sites with JBake and Jetty.

Add jbake-maven-plugin to build section in POM:

  <build>
    <plugins>
      <plugin>
        <groupId>de.bildschirmarbeiter.jbake</groupId>
        <artifactId>jbake-maven-plugin</artifactId>
        <version>0.0.2</version>
        <executions>
          <execution>
            <goals>
              <goal>bake</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.thymeleaf</groupId>
            <artifactId>thymeleaf</artifactId>
            <version>3.0.7.RELEASE</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

Baking is done during phase process-resources by default.

Goals

Bake

Will bake the site once.

mvn jbake:bake

Watch

Will bake the site and watch for changes in source, baking again on any change.

mvn jbake:watch

Serve

Will bake the site, watch for changes in source (baking again on any change) and serve the site with Jetty.

mvn jbake:serve

Configuration

parameter default goals description
source src/main/jbake all The source directory where assets, content templates and jbake.properties are stored.
Parameter is passed to JBake Oven.
destination target/jbake all The destination directory where the baked site is written to.
Parameter is passed to JBake Oven.
clearCache true all The local cache is cleared when true.
Parameter is passed to JBake Oven.
cleanDestination true watch, serve All files in destination directory are removed when true before baking. This prevents orphaned files, but requires a full bake (see local cache).
failOnError true all Breaks the build when true and errors occur during baking in JBake Oven.
port 8080 serve The HTTP port Jetty is listening on.
Parameter is passed to Jetty Server.

All parameters can be set on command line with prefix jbake as usual, e.g.:

mvn jbake:serve -Djbake.source=src/main/resources -Djbake.destination=target/site -Djbake.port=8181

For details see JBake's documentation.