Skip to content

Commit

Permalink
First Version
Browse files Browse the repository at this point in the history
  • Loading branch information
aldrinleal committed Sep 13, 2013
0 parents commit 9ff9fed
Show file tree
Hide file tree
Showing 6 changed files with 466 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.settings
.idea
target
.classpath
.project
*.log
*.iml
9 changes: 9 additions & 0 deletions .hgignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.settings
.idea
target
.classpath
.project
syntax:glob
*.log
syntax:glob
*.iml
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: java

jdk:
- oraclejdk7
- openjdk6
254 changes: 254 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>

<groupId>br.com.ingenieux</groupId>
<artifactId>jbake-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>0.0.1-SNAPSHOT</version>

<description>jbake-maven-plugin is a plugin to integrate JBake into your projects</description>
<url>http://docs.ingenieux.com.br/jbake-maven-plugin/</url>
<inceptionYear>2013</inceptionYear>

<licenses>
<license>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<name>Apache 2.0</name>
</license>
</licenses>

<distributionManagement>
<site>
<id>docs.ingenieux.com.br</id>
<name>ingenieux Beanstalker Site</name>
<url>s3://docs.ingenieux.com.br/projects/jbake-maven-plugin/</url>
</site>
</distributionManagement>

<organization>
<name>ingenieux</name>
<url>http://ingenieux.com.br</url>
</organization>

<developers>
<developer>
<id>aldrinleal</id>
<name>Aldrin Leal</name>
<timezone>-3</timezone>
</developer>
</developers>

<issueManagement>
<system>github</system>
<url>https://bitbucket.org/ingenieux/jbake-maven-plugin/</url>
</issueManagement>

<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<scm>
<connection>scm:hg:http://bitbucket.org/ingenieux/jbake-maven-plugin</connection>
<developerConnection>scm:hg:ssh://[email protected]/ingenieux/jbake-maven-plugin</developerConnection>
<url>http://bitbucket.org/ingenieux/jbake-maven-plugin</url>
</scm>

<dependencies>
<dependency>
<groupId>org.jbake.app</groupId>
<artifactId>jbake</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-build-api</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.hudson.winstone</groupId>
<artifactId>winstone</artifactId>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jbake.app</groupId>
<artifactId>jbake</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>2.0-alpha-1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.12</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-build-api</artifactId>
<version>0.0.7</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.jvnet.hudson.winstone</groupId>
<artifactId>winstone</artifactId>
<version>0.9.10-hudson-24</version>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<extensions>
<extension>
<groupId>org.kuali.maven.wagons</groupId>
<artifactId>maven-s3-wagon</artifactId>
<version>1.1.20</version>
</extension>
</extensions>

<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.2</version>
<inherited>true</inherited>
<configuration>
<requirements>
<jdk>1.7</jdk>
</requirements>
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
<executions>
<execution>
<id>mojo-descriptor</id>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
<!-- if you want to generate help goal -->
<execution>
<id>help-goal</id>
<goals>
<goal>helpmojo</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<!-- http://maven.apache.org/plugins/maven-compiler-plugin/ -->
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.2</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-markdown</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin>
</plugins>
</reporting>
</project>
56 changes: 56 additions & 0 deletions src/main/java/br/com/ingenieux/mojo/jbake/GenerateMojo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package br.com.ingenieux.mojo.jbake;

/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import java.io.File;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.jbake.app.Oven;

/**
* Runs jbake on a folder
*/
@Mojo(name = "generate")
public class GenerateMojo extends AbstractMojo {
/**
* Location of the Output Directory.
*/
@Parameter(property = "jbake.outputDirectory", defaultValue = "${project.build.directory}/${project.build.finalName}", required = true)
private File outputDirectory;

/**
* Location of the Output Directory.
*/
@Parameter(property = "jbake.inputDirectory", defaultValue = "${project.basedir}/src/main/jbake", required = true)
private File inputDirectory;

public void execute() throws MojoExecutionException {
try {
Oven oven = new Oven(inputDirectory, outputDirectory);

oven.setupPaths();
oven.bake();
} catch (Exception e) {
getLog().info("Oops", e);

throw new MojoExecutionException("Failure when running: ", e);
}
}
}
Loading

0 comments on commit 9ff9fed

Please sign in to comment.