| <?xml version="1.0"?> |
| |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You 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 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> |
| <groupId>org.apache.felix.karaf</groupId> |
| <artifactId>karaf</artifactId> |
| <version>1.1.0-SNAPSHOT</version> |
| </parent> |
| |
| <modelVersion>4.0.0</modelVersion> |
| <groupId>org.apache.felix.karaf</groupId> |
| <artifactId>manual</artifactId> |
| <version>1.1.0-SNAPSHOT</version> |
| <packaging>pom</packaging> |
| <name>Apache Felix Karaf :: Manual</name> |
| <description>The Karaf Manual which generates a HTML and PDF representation of the manual.</description> |
| |
| <properties> |
| <must-succeed>false</must-succeed> |
| </properties> |
| |
| <build> |
| <plugins> |
| |
| <plugin> |
| <artifactId>maven-antrun-plugin</artifactId> |
| <version>1.2</version> |
| <executions> |
| <execution> |
| <configuration> |
| <tasks> |
| <taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" classpathref="maven.plugin.classpath"/> |
| <taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" classpathref="maven.plugin.classpath"/> |
| <taskdef name="trycatch" classname="net.sf.antcontrib.logic.TryCatchTask" classpathref="maven.plugin.classpath"/> |
| <property name="ant.regexp.regexpimpl" value="org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp" /> |
| <property name="manual.dir" value="target/site/manual" /> |
| <property name="manual" value="${manual.dir}/manual-${project.version}.html" /> |
| <mkdir dir="${manual.dir}"/> |
| <trycatch property="error"> |
| <try> |
| <get src="http://cwiki.apache.org/confluence/display/FELIX/Karaf+Users%27+Guide+in+one+page" |
| dest="${manual}" /> |
| <for list="1,2,3,4,5,6,7,8,9,10" param="letter"> |
| <sequential> |
| <replaceregexp |
| file="${manual}" |
| flags="g" |
| match='"/confluence/display/FELIX/([^"]*)\+([^"+]*)"' |
| replace='"/confluence/display/FELIX/\1\2"' /> |
| </sequential> |
| </for> |
| <replaceregexp |
| file="${manual}" |
| flags="g" |
| match='"/confluence/display/FELIX/([^"]*)"' |
| replace='"#KarafUsers%27Guideinonepage-\1"' /> |
| <replaceregexp |
| file="${manual}" |
| flags="g" |
| match='"/confluence/([^"]*)"' |
| replace='"http://cwiki.apache.org/confluence/\1"' /> |
| </try> |
| <catch> |
| <if> |
| <equals arg1="${must-succeed}" arg2="true"/> |
| <then> |
| <fail>${error}</fail> |
| </then> |
| <else> |
| <copy file="src/fallback/manual.html" tofile="${manual}" /> |
| </else> |
| </if> |
| </catch> |
| </trycatch> |
| </tasks> |
| </configuration> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| <phase>generate-resources</phase> |
| </execution> |
| </executions> |
| <dependencies> |
| <dependency> |
| <groupId>ant-contrib</groupId> |
| <artifactId>ant-contrib</artifactId> |
| <version>1.0b3</version> |
| </dependency> |
| <dependency> |
| <groupId>ant</groupId> |
| <artifactId>ant-optional</artifactId> |
| <version>1.5.3-1</version> |
| </dependency> |
| </dependencies> |
| </plugin> |
| |
| <plugin> |
| <groupId>org.apache.camel</groupId> |
| <artifactId>maven-html-to-pdf</artifactId> |
| <version>2.0.0</version> |
| <executions> |
| <execution> |
| <goals> |
| <goal>compile</goal> |
| </goals> |
| <phase>compile</phase> |
| </execution> |
| </executions> |
| <configuration> |
| <page>file://${basedir}/target/site/manual/manual-${project.version}.html</page> |
| <head><![CDATA[ |
| <link href="file:${basedir}/src/styles/print.css" rel="stylesheet" type="text/css" /> |
| <style type="text/css"> |
| @page :left { |
| @top-left { |
| content: "Apache Felix Karaf ${pom.version} Developer's Manual"; |
| } |
| } |
| </style> |
| ]]></head> |
| <replaceToken><![CDATA[ |
| >top</a> |
| ]]></replaceToken> |
| <replaceValue><![CDATA[ |
| ></a> |
| ]]></replaceValue> |
| <errorOnConverionFailure>${must-succeed}</errorOnConverionFailure> |
| <errorOnDownloadFailure>${must-succeed}</errorOnDownloadFailure> |
| </configuration> |
| </plugin> |
| <plugin> |
| <groupId>org.codehaus.mojo</groupId> |
| <artifactId>build-helper-maven-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>attach-artifacts</id> |
| <phase>package</phase> |
| <goals> |
| <goal>attach-artifact</goal> |
| </goals> |
| <configuration> |
| <artifacts> |
| <!-- Don't need to attach PDF here because the html-to-pdf plugin did that already --> |
| <artifact> |
| <file>${project.build.directory}/site/manual/manual-${project.version}.html</file> |
| <type>html</type> |
| </artifact> |
| </artifacts> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| |
| <profiles> |
| <profile> |
| <id>release</id> |
| <properties> |
| <must-succeed>true</must-succeed> |
| </properties> |
| </profile> |
| </profiles> |
| |
| </project> |