Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 1 | <?xml version="1.0"?> |
| 2 | |
| 3 | <!-- |
| 4 | Licensed to the Apache Software Foundation (ASF) under one or more |
| 5 | contributor license agreements. See the NOTICE file distributed with |
| 6 | this work for additional information regarding copyright ownership. |
| 7 | The ASF licenses this file to You under the Apache License, Version 2.0 |
| 8 | (the "License"); you may not use this file except in compliance with |
| 9 | the License. You may obtain a copy of the License at |
| 10 | |
| 11 | http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | |
| 13 | Unless required by applicable law or agreed to in writing, software |
| 14 | distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | See the License for the specific language governing permissions and |
| 17 | limitations under the License. |
| 18 | --> |
| 19 | |
| 20 | <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"> |
| 21 | |
| 22 | <parent> |
| 23 | <groupId>org.apache.felix.karaf</groupId> |
| 24 | <artifactId>karaf</artifactId> |
| 25 | <version>1.1.0-SNAPSHOT</version> |
| 26 | </parent> |
| 27 | |
| 28 | <modelVersion>4.0.0</modelVersion> |
| 29 | <groupId>org.apache.felix.karaf</groupId> |
| 30 | <artifactId>manual</artifactId> |
| 31 | <version>1.1.0-SNAPSHOT</version> |
| 32 | <packaging>pom</packaging> |
| 33 | <name>Karaf :: Manual</name> |
| 34 | <description>The Karaf Manual which generates a HTML and PDF representation of the manual.</description> |
| 35 | |
Guillaume Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 36 | <properties> |
| 37 | <must-succeed>false</must-succeed> |
| 38 | </properties> |
| 39 | |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 40 | <build> |
| 41 | <plugins> |
| 42 | |
| 43 | <plugin> |
| 44 | <artifactId>maven-antrun-plugin</artifactId> |
| 45 | <version>1.2</version> |
| 46 | <executions> |
| 47 | <execution> |
| 48 | <configuration> |
| 49 | <tasks> |
Guillaume Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 50 | <taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" classpathref="maven.plugin.classpath"/> |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 51 | <taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" classpathref="maven.plugin.classpath"/> |
Guillaume Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 52 | <taskdef name="trycatch" classname="net.sf.antcontrib.logic.TryCatchTask" classpathref="maven.plugin.classpath"/> |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 53 | <property name="ant.regexp.regexpimpl" value="org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp" /> |
Guillaume Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 54 | <property name="manual.dir" value="target/site/manual" /> |
| 55 | <property name="manual" value="${manual.dir}/manual-${project.version}.html" /> |
| 56 | <mkdir dir="${manual.dir}"/> |
| 57 | <trycatch property="error"> |
| 58 | <try> |
| 59 | <get src="http://cwiki.apache.org/confluence/display/FELIX/Karaf+Users%27+Guide+in+one+page" |
| 60 | dest="${manual}" /> |
| 61 | <for list="1,2,3,4,5,6,7,8,9,10" param="letter"> |
| 62 | <sequential> |
| 63 | <replaceregexp |
| 64 | file="${manual}" |
| 65 | flags="g" |
| 66 | match='"/confluence/display/FELIX/([^"]*)\+([^"+]*)"' |
| 67 | replace='"/confluence/display/FELIX/\1\2"' /> |
| 68 | </sequential> |
| 69 | </for> |
| 70 | <replaceregexp |
| 71 | file="${manual}" |
| 72 | flags="g" |
| 73 | match='"/confluence/display/FELIX/([^"]*)"' |
| 74 | replace='"#KarafUsers%27Guideinonepage-\1"' /> |
| 75 | <replaceregexp |
| 76 | file="${manual}" |
| 77 | flags="g" |
| 78 | match='"/confluence/([^"]*)"' |
| 79 | replace='"http://cwiki.apache.org/confluence/\1"' /> |
| 80 | </try> |
| 81 | <catch> |
| 82 | <if> |
| 83 | <equals arg1="${must-succeed}" arg2="true"/> |
| 84 | <then> |
| 85 | <fail>${error}</fail> |
| 86 | </then> |
| 87 | <else> |
| 88 | <copy file="src/fallback/manual.html" tofile="${manual}" /> |
| 89 | </else> |
| 90 | </if> |
| 91 | </catch> |
| 92 | </trycatch> |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 93 | </tasks> |
| 94 | </configuration> |
| 95 | <goals> |
| 96 | <goal>run</goal> |
| 97 | </goals> |
| 98 | <phase>generate-resources</phase> |
| 99 | </execution> |
| 100 | </executions> |
| 101 | <dependencies> |
| 102 | <dependency> |
| 103 | <groupId>ant-contrib</groupId> |
| 104 | <artifactId>ant-contrib</artifactId> |
| 105 | <version>1.0b3</version> |
| 106 | </dependency> |
| 107 | <dependency> |
| 108 | <groupId>ant</groupId> |
| 109 | <artifactId>ant-optional</artifactId> |
| 110 | <version>1.5.3-1</version> |
| 111 | </dependency> |
| 112 | </dependencies> |
| 113 | </plugin> |
| 114 | |
| 115 | <plugin> |
| 116 | <groupId>org.apache.camel</groupId> |
| 117 | <artifactId>maven-html-to-pdf</artifactId> |
| 118 | <version>2.0.0</version> |
| 119 | <executions> |
| 120 | <execution> |
| 121 | <goals> |
| 122 | <goal>compile</goal> |
| 123 | </goals> |
| 124 | <phase>compile</phase> |
| 125 | </execution> |
| 126 | </executions> |
| 127 | <configuration> |
Guillaume Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 128 | <page>file://${basedir}/target/site/manual/manual-${project.version}.html</page> |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 129 | <head><![CDATA[ |
| 130 | <link href="file:${basedir}/src/styles/print.css" rel="stylesheet" type="text/css" /> |
| 131 | <style type="text/css"> |
| 132 | @page :left { |
| 133 | @top-left { |
| 134 | content: "Apache Felix Karaf ${pom.version} Developer's Manual"; |
| 135 | } |
| 136 | } |
| 137 | </style> |
| 138 | ]]></head> |
| 139 | <replaceToken><![CDATA[ |
| 140 | >top</a> |
| 141 | ]]></replaceToken> |
| 142 | <replaceValue><![CDATA[ |
| 143 | ></a> |
| 144 | ]]></replaceValue> |
Guillaume Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 145 | <errorOnConverionFailure>${must-succeed}</errorOnConverionFailure> |
| 146 | <errorOnDownloadFailure>${must-succeed}</errorOnDownloadFailure> |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 147 | </configuration> |
| 148 | </plugin> |
| 149 | <plugin> |
| 150 | <groupId>org.codehaus.mojo</groupId> |
| 151 | <artifactId>build-helper-maven-plugin</artifactId> |
| 152 | <executions> |
| 153 | <execution> |
| 154 | <id>attach-artifacts</id> |
| 155 | <phase>package</phase> |
| 156 | <goals> |
| 157 | <goal>attach-artifact</goal> |
| 158 | </goals> |
| 159 | <configuration> |
| 160 | <artifacts> |
| 161 | <!-- Don't need to attach PDF here because the html-to-pdf plugin did that already --> |
| 162 | <artifact> |
| 163 | <file>${project.build.directory}/site/manual/manual-${project.version}.html</file> |
| 164 | <type>html</type> |
| 165 | </artifact> |
| 166 | </artifacts> |
| 167 | </configuration> |
| 168 | </execution> |
| 169 | </executions> |
| 170 | </plugin> |
| 171 | </plugins> |
| 172 | </build> |
| 173 | |
Guillaume Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 174 | <profiles> |
| 175 | <profile> |
| 176 | <id>release</id> |
| 177 | <properties> |
| 178 | <must-succeed>true</must-succeed> |
| 179 | </properties> |
| 180 | </profile> |
| 181 | </profiles> |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 182 | |
| 183 | </project> |