Improve build to ease configuration when building multiple PDF files
git-svn-id: https://svn.apache.org/repos/asf/servicemix/documentation/trunk@1066223 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index 760095a..0d35c97 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,475 +21,464 @@
<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">
- <parent>
+ <parent>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-pom</artifactId>
+ <version>4</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
<groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-pom</artifactId>
- <version>4</version>
- </parent>
+ <artifactId>documentation</artifactId>
+ <name>Apache ServiceMix Documentation</name>
+ <version>4.3.0-SNAPSHOT</version>
+ <packaging>war</packaging>
- <modelVersion>4.0.0</modelVersion>
+ <properties>
+ <netbeans.hint.deploy.server>Tomcat60</netbeans.hint.deploy.server>
+ <jetty-port>8080</jetty-port>
+ <webapp.srcdir>${project.basedir}/src/main/webapp</webapp.srcdir>
+ <webapp.dir>${project.build.directory}/webapp</webapp.dir>
+ <maven.wagon.version>1.0-beta-6</maven.wagon.version>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>documentation</artifactId>
- <name>Apache ServiceMix Documentation</name>
- <version>4.3.0-SNAPSHOT</version>
- <packaging>war</packaging>
+ <pdf.required>false</pdf.required>
- <properties>
- <netbeans.hint.deploy.server>Tomcat60</netbeans.hint.deploy.server>
- <jetty-port>8080</jetty-port>
- <webapp.srcdir>${project.basedir}/src/main/webapp</webapp.srcdir>
- <webapp.dir>${project.build.directory}/webapp</webapp.dir>
- <maven.wagon.version>1.0-beta-6</maven.wagon.version>
+ <scala.version>2.8.1</scala.version>
- <pdf.required>false</pdf.required>
+ <scalate.version>1.4.0-SNAPSHOT</scalate.version>
+ <scalate.mode>production</scalate.mode>
+ <scalate.workdir>${basedir}/target/scalateWorkDir</scalate.workdir>
- <scala.version>2.8.1</scala.version>
+ <components.version>2011.01-SNAPSHOT</components.version>
+ <karaf.version>2.1.99-SNAPSHOT</karaf.version>
+ <servicemix.version>4.3.0-SNAPSHOT</servicemix.version>
+ </properties>
- <scalate.version>1.4.0-SNAPSHOT</scalate.version>
- <scalate.mode>production</scalate.mode>
- <scalate.workdir>${basedir}/target/scalateWorkDir</scalate.workdir>
-
- <components.version>2011.01-SNAPSHOT</components.version>
- <karaf.version>2.1.99-SNAPSHOT</karaf.version>
- <servicemix.version>4.3.0-SNAPSHOT</servicemix.version>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.fusesource.scalate</groupId>
- <artifactId>scalate-wikitext</artifactId>
- <version>${scalate.version}</version>
- </dependency>
- <dependency>
- <groupId>org.fusesource.scalate</groupId>
- <artifactId>scalate-page</artifactId>
- <version>${scalate.version}</version>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <version>0.9.24</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.6.0</version>
- </dependency>
-
- <!-- ensure that the components are available in the local repo -->
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-bean</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-cxf-bc</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-cxf-se</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-drools</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-eip</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-exec</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-file</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-ftp</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-http</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-jms</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-mail</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-osworkflow</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-quartz</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-saxon</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-scripting</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-snmp</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-validation</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-vfs</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-xmpp</artifactId>
- <version>${components.version}</version>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.fusesource.scalate</groupId>
- <artifactId>maven-scalate-plugin</artifactId>
- <version>${scalate.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <dependencyManagement>
<dependencies>
- <dependency>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-compiler</artifactId>
- <version>${scala.version}</version>
- </dependency>
- <dependency>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-library</artifactId>
- <version>${scala.version}</version>
- </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.fusesource.scalate</groupId>
+ <artifactId>scalate-wikitext</artifactId>
+ <version>${scalate.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.fusesource.scalate</groupId>
+ <artifactId>scalate-page</artifactId>
+ <version>${scalate.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>0.9.24</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.0</version>
+ </dependency>
+
+ <!-- ensure that the components are available in the local repo -->
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-bean</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-cxf-bc</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-cxf-se</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-drools</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-eip</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-exec</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-file</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-ftp</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-http</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-jms</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-mail</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-osworkflow</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-quartz</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-saxon</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-scripting</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-snmp</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-validation</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-vfs</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix-xmpp</artifactId>
+ <version>${components.version}</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.fusesource.scalate</groupId>
+ <artifactId>maven-scalate-plugin</artifactId>
+ <version>${scalate.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
- </dependencyManagement>
- <build>
- <plugins>
- <plugin>
- <groupId>org.scala-tools</groupId>
- <artifactId>maven-scala-plugin</artifactId>
- <version>2.15.0</version>
- <executions>
- <execution>
- <id>compile</id>
- <goals>
- <goal>compile</goal>
- <goal>testCompile</goal>
- </goals>
- </execution>
- <execution>
- <id>generate-components-docs</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>script</goal>
- </goals>
- <configuration>
- <includeScopes>plugin</includeScopes>
- <scriptFile>src/main/scripts/GenerateComponentDocs.scala</scriptFile>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <!-- Unpack the manual sources into the /karaf subdirectory -->
- <id>unpack-karaf-manual</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.karaf</groupId>
- <artifactId>org.apache.karaf.doc</artifactId>
- <version>${karaf.version}</version>
- <type>war</type>
- <outputDirectory>${project.build.directory}/webapp/karaf</outputDirectory>
- <includes>developers-guide/*.conf,users-guide/*.conf</includes>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- <execution>
- <!-- Unpack the commands documentation sources into the /commands -->
- <id>unpack-karaf-commands</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.karaf</groupId>
- <artifactId>org.apache.karaf.doc</artifactId>
- <version>${karaf.version}</version>
- <type>war</type>
- <outputDirectory>${project.build.directory}/webapp</outputDirectory>
- <includes>commands/*.conf</includes>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <id>filter</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>${webapp.dir}</outputDirectory>
- <resources>
- <resource>
- <directory>${webapp.srcdir}</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.fusesource.scalate</groupId>
- <artifactId>maven-scalate-plugin</artifactId>
- <version>${scalate.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>sitegen-no-fork</goal>
- </goals>
- <phase>prepare-package</phase>
- <configuration>
- <warSourceDirectory>${webapp.dir}</warSourceDirectory>
- </configuration>
- </execution>
- </executions>
- <configuration>
- <warSourceDirectory>${webapp.dir}</warSourceDirectory>
- <remoteServerId>people.apache.org</remoteServerId>
- <remoteServerUrl>scp://people.apache.org/www/servicemix.apache.org/docs/${servicemix.version}</remoteServerUrl>
- </configuration>
+ <dependencyManagement>
<dependencies>
- <dependency>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-ssh</artifactId>
- <version>${maven.wagon.version}</version>
- </dependency>
+ <dependency>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-compiler</artifactId>
+ <version>${scala.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ <version>${scala.version}</version>
+ </dependency>
</dependencies>
- </plugin>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.1</version>
- <configuration>
- <warSourceDirectory>${webapp.dir}</warSourceDirectory>
- <archive>
- <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-maven-plugin</artifactId>
- <version>7.1.5.v20100705</version>
- <configuration>
- <webAppConfig>
- <contextPath>/</contextPath>
- <baseResource implementation="org.eclipse.jetty.util.resource.ResourceCollection">
- <resourcesAsCSV>${webapp.srcdir},${webapp.dir}</resourcesAsCSV>
- </baseResource>
- </webAppConfig>
- <systemProperties>
- <systemProperty>
- <name>scalate.workdir</name>
- <value>${scalate.workdir}</value>
- </systemProperty>
- <systemProperty>
- <name>scalate.mode</name>
- <value>${scalate.mode}</value>
- </systemProperty>
- <systemProperty>
- <name>logback.configurationFile</name>
- <value>${basedir}/src/etc/logback.xml</value>
- </systemProperty>
- </systemProperties>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>2.1.0</version>
- <executions>
- <execution>
- <id>bundle-manifest</id>
- <phase>prepare-package</phase>
- <goals>
- <goal>manifest</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <supportedProjectTypes>
- <supportedProjectType>jar</supportedProjectType>
- <supportedProjectType>bundle</supportedProjectType>
- <supportedProjectType>war</supportedProjectType>
- </supportedProjectTypes>
- <instructions>
- <Import-Package>javax.servlet,javax.servlet.http,org.osgi.framework,org.osgi.service.packageadmin,javax.swing.tree</Import-Package>
- <Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
- <Embed-Directory>WEB-INF/lib</Embed-Directory>
- <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
- <Embed-Transitive>true</Embed-Transitive>
- <Webapp-Context>documentation</Webapp-Context>
- </instructions>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.2</version>
- <executions>
- <execution>
- <id>generate-pdf</id>
- <configuration>
- <tasks>
- <ant antfile="${project.basedir}/src/main/ant/generate-pdfs.xml"
- dir="${project.basedir}">
- <property name="pdf.required" value="${pdf.required}"/>
- </ant>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- <phase>package</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ </dependencyManagement>
- <!-- Scalate snapshots -->
- <repositories>
- <repository>
- <id>fusesource.snapshots</id>
- <url>http://repo.fusesource.com/nexus/content/groups/public-snapshots</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.scala-tools</groupId>
+ <artifactId>maven-scala-plugin</artifactId>
+ <version>2.15.0</version>
+ <executions>
+ <execution>
+ <id>compile</id>
+ <goals>
+ <goal>compile</goal>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>generate-components-docs</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>script</goal>
+ </goals>
+ <configuration>
+ <includeScopes>plugin</includeScopes>
+ <scriptFile>src/main/scripts/GenerateComponentDocs.scala</scriptFile>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-pdfs</id>
+ <phase>package</phase>
+ <goals>
+ <goal>script</goal>
+ </goals>
+ <configuration>
+ <includeScopes>plugin</includeScopes>
+ <scriptFile>src/main/scripts/GeneratePdfDocuments.scala</scriptFile>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
- <!-- Scalate snapshots -->
- <pluginRepositories>
- <pluginRepository>
- <id>fusesource.snapshots</id>
- <url>http://repo.fusesource.com/nexus/content/groups/public-snapshots</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <!-- Unpack the manual sources into the /karaf subdirectory -->
+ <id>unpack-karaf-manual</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.karaf</groupId>
+ <artifactId>org.apache.karaf.doc</artifactId>
+ <version>${karaf.version}</version>
+ <type>war</type>
+ <outputDirectory>${project.build.directory}/webapp/karaf</outputDirectory>
+ <includes>developers-guide/*.conf,users-guide/*.conf</includes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ <execution>
+ <!-- Unpack the commands documentation sources into the /commands -->
+ <id>unpack-karaf-commands</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.karaf</groupId>
+ <artifactId>org.apache.karaf.doc</artifactId>
+ <version>${karaf.version}</version>
+ <type>war</type>
+ <outputDirectory>${project.build.directory}/webapp</outputDirectory>
+ <includes>commands/*.conf</includes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>filter</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${webapp.dir}</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${webapp.srcdir}</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.fusesource.scalate</groupId>
+ <artifactId>maven-scalate-plugin</artifactId>
+ <version>${scalate.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>sitegen-no-fork</goal>
+ </goals>
+ <phase>prepare-package</phase>
+ <configuration>
+ <warSourceDirectory>${webapp.dir}</warSourceDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <warSourceDirectory>${webapp.dir}</warSourceDirectory>
+ <remoteServerId>people.apache.org</remoteServerId>
+ <remoteServerUrl>scp://people.apache.org/www/servicemix.apache.org/docs/${servicemix.version}</remoteServerUrl>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-ssh</artifactId>
+ <version>${maven.wagon.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1</version>
+ <configuration>
+ <warSourceDirectory>${webapp.dir}</warSourceDirectory>
+ <archive>
+ <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>7.1.5.v20100705</version>
+ <configuration>
+ <webAppConfig>
+ <contextPath>/</contextPath>
+ <baseResource implementation="org.eclipse.jetty.util.resource.ResourceCollection">
+ <resourcesAsCSV>${webapp.srcdir},${webapp.dir}</resourcesAsCSV>
+ </baseResource>
+ </webAppConfig>
+ <systemProperties>
+ <systemProperty>
+ <name>scalate.workdir</name>
+ <value>${scalate.workdir}</value>
+ </systemProperty>
+ <systemProperty>
+ <name>scalate.mode</name>
+ <value>${scalate.mode}</value>
+ </systemProperty>
+ <systemProperty>
+ <name>logback.configurationFile</name>
+ <value>${basedir}/src/etc/logback.xml</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>2.1.0</version>
+ <executions>
+ <execution>
+ <id>bundle-manifest</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>manifest</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <supportedProjectTypes>
+ <supportedProjectType>jar</supportedProjectType>
+ <supportedProjectType>bundle</supportedProjectType>
+ <supportedProjectType>war</supportedProjectType>
+ </supportedProjectTypes>
+ <instructions>
+ <Import-Package>javax.servlet,javax.servlet.http,org.osgi.framework,org.osgi.service.packageadmin,javax.swing.tree</Import-Package>
+ <Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
+ <Embed-Directory>WEB-INF/lib</Embed-Directory>
+ <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Webapp-Context>documentation</Webapp-Context>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!-- Scalate snapshots -->
+ <repositories>
+ <repository>
+ <id>fusesource.snapshots</id>
+ <url>http://repo.fusesource.com/nexus/content/groups/public-snapshots</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <!-- Scalate snapshots -->
+ <pluginRepositories>
+ <pluginRepository>
+ <id>fusesource.snapshots</id>
+ <url>http://repo.fusesource.com/nexus/content/groups/public-snapshots</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
<profiles>
@@ -498,38 +487,6 @@
<properties>
<pdf.required>true</pdf.required>
</properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.5</version>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <phase>verify</phase>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <configuration>
- <artifacts>
- <artifact>
- <file>${project.build.directory}/sitegen/users-guide/manual.pdf</file>
- <type>pdf</type>
- <classifier>users-guide</classifier>
- </artifact>
- <artifact>
- <file>${project.build.directory}/sitegen/jbi/jbi-guide.pdf</file>
- <type>pdf</type>
- <classifier>jbi-guide</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
</profile>
</profiles>
diff --git a/src/main/ant/generate-pdfs.xml b/src/main/ant/generate-pdfs.xml
deleted file mode 100644
index c82e953..0000000
--- a/src/main/ant/generate-pdfs.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2009-2010 the original author or authors.
- See the notice.md file distributed with this work for additional
- information regarding copyright ownership.
-
- 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.
-
--->
-<project name="generate-pdfs" default="all" basedir=".">
-
- <property name="sitegen" value="${basedir}/target/sitegen"/>
- <property name="target" value="${basedir}/target"/>
-
- <macrodef name="prince">
- <attribute name="document" />
- <attribute name="input" default="${sitegen}/@{document}.html"/>
- <attribute name="output" default="${sitegen}/@{document}.pdf"/>
- <sequential>
- <echo message="Running Prince XML (http://princexml.com)" />
- <echo message=" converting @{input}"/>
- <echo message=" into @{output}"/>
- <exec executable="prince" failifexecutionfails="${pdf.required}">
- <arg value="@{input}" />
- <arg value="@{output}" />
- <arg value="--log"/>
- <arg value="${target}/prince.log"/>
- </exec>
- </sequential>
- </macrodef>
-
- <target name="jbi" description="Generate the JBI Guide PDF">
- <prince document="jbi/jbi-guide"/>
- </target>
-
- <target name="camel" description="Generate the Camel Guide PDF">
- <prince document="users-guide/camel/manual"/>
- </target>
-
- <target name="getting-started" description="Generate the Getting Started Guide PDF">
- <prince document="users-guide/getting-started/manual"/>
- </target>
-
-
- <target name="migration" description="Generate the Migration Guide PDF">
- <prince document="users-guide/migration/manual"/>
- </target>
-
- <target name="nmr" description="Generate the NMR Guide PDF">
- <prince document="users-guide/nmr/manual"/>
- </target>
-
-
- <target name="all" depends="jbi,camel,getting-started,migration,nmr" description="Generate all the PDF documents">
- <!-- convenience target to generate all the PDFs -->
- </target>
-
-</project>
\ No newline at end of file
diff --git a/src/main/scripts/GeneratePdfDocuments.scala b/src/main/scripts/GeneratePdfDocuments.scala
new file mode 100644
index 0000000..18ea55f
--- /dev/null
+++ b/src/main/scripts/GeneratePdfDocuments.scala
@@ -0,0 +1,71 @@
+/**
+ * Copyright (C) 2009-2010 the original author or authors.
+ * See the notice.md file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * 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, PrintWriter}
+import org.apache.maven.project.{MavenProjectHelper, DefaultMavenProjectHelper}
+import scala.io.Source
+
+val TARGET = new File(project("project.build.directory"))
+val LOG_FILE = new PrintWriter(new File(TARGET, "prince.log"))
+val SITEGEN = new File(TARGET, "sitegen")
+val PDF_REQUIRED = project("pdf.required").toBoolean
+
+val helper = session.lookup(MavenProjectHelper.ROLE).asInstanceOf[MavenProjectHelper]
+
+def debug(message: String) = LOG_FILE.println(message)
+def info(message: String) = log.info(message)
+def warn(message: String) = log.warn(message)
+
+def createPdf(input: File) {
+ info("- converting " + input)
+ val pdf = new File(input.getParent, input.getName.take(input.getName.length-5))
+ val process = new ProcessBuilder("prince", input.getCanonicalPath, "-o", pdf.getCanonicalPath)
+ .redirectErrorStream(true)
+ .start
+ process.waitFor
+ Source.fromInputStream(process.getInputStream).getLines.foreach(debug)
+
+ pdf.exists match {
+ case false if PDF_REQUIRED =>
+ throw new RuntimeException("PDF generation required but failed to convert %".format(input))
+ case false if !PDF_REQUIRED =>
+ warn(" conversion to PDF failed - check %s for more information".format(LOG_FILE))
+ case true =>
+ helper.attachArtifact(project.getWrapped, "pdf", pdf.getName.split("\\.").head, pdf)
+ }
+}
+
+def createPdfs(dir: File) {
+ for (file <- dir.listFiles) {
+ if (file.isDirectory) {
+ createPdfs(file)
+ } else if (file.getName.endsWith(".pdf.html")) {
+ createPdf(file)
+ }
+ }
+}
+
+try {
+ info("Running Prince XML (http://princexml.com) to convert HTML to PDF")
+ createPdfs(SITEGEN)
+} catch {
+ case e: Exception if !PDF_REQUIRED => warn("An error occured while generating PDF files: " + e.getMessage)
+} finally {
+ LOG_FILE.flush
+ LOG_FILE.close
+}
+
diff --git a/src/main/webapp/jbi/jbi-guide.conf b/src/main/webapp/jbi/jbi-guide.pdf.conf
similarity index 100%
rename from src/main/webapp/jbi/jbi-guide.conf
rename to src/main/webapp/jbi/jbi-guide.pdf.conf
diff --git a/src/main/webapp/users-guide/camel/manual.conf b/src/main/webapp/users-guide/camel/camel-guide.pdf.conf
similarity index 100%
rename from src/main/webapp/users-guide/camel/manual.conf
rename to src/main/webapp/users-guide/camel/camel-guide.pdf.conf
diff --git a/src/main/webapp/users-guide/nmr/manual.conf b/src/main/webapp/users-guide/nmr/nmr-guide.pdf.conf
similarity index 100%
rename from src/main/webapp/users-guide/nmr/manual.conf
rename to src/main/webapp/users-guide/nmr/nmr-guide.pdf.conf