Maven site & TWiki

written by juan on October 28th, 2007 @ 06:55 PM

Some time ago we wrote a TWiki parser for Maven: the doxia-module-twiki.

One of the use cases for the plugin was to be able to generate maven site sites with TWiki pages. These are the instructions to be able to do this:

First you must have a maven-site structure like this:

project-site $ tree
.
|-- pom.xml
`-- src
    `-- site
        `-- twiki
            `-- main.twiki

Where the pom.xml looks like:

<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>

  <name>Project</name>
  <artifactId>project-site</artifactId>
  <groupId>ar.com....</groupId>
  <packaging>pom</packaging>
  <description>
    Documentation for project
  </description>

  <pluginRepositories>
    <pluginRepository>
      <id>apache.org</id>
      <name>Maven Plugin Snapshots</name>
      <url>http://people.apache.org/repo/m2-snapshot-repository</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>
      
  <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>2.0-beta-6-SNAPSHOT</version>
            <dependencies>
                <dependency>
                    <groupId>org.apache.maven.doxia</groupId>
                    <artifactId>doxia-module-twiki</artifactId>
                    <version>1.0-alpha-10-SNAPSHOT</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
  </build>
</project>

And main.twiki contains TWiki document like:

---+ Test

This is a *test*:
   * item1
   * item2

If you render the site with the command mvn site you will get an html version of the twiki page: output example

Comments are closed

Options:

Size

Colors