Filippo Diotalevi | b4c8e3e | 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> |
Guillaume Nodet | 276a750 | 2009-10-14 11:44:17 +0000 | [diff] [blame] | 33 | <name>Apache Felix Karaf :: Manual</name> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 34 | <description>The Karaf Manual which generates a HTML and PDF representation of the manual.</description> |
| 35 | |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 36 | <properties> |
| 37 | <must-succeed>false</must-succeed> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 38 | |
| 39 | <manual.dir>${project.build.directory}/manual</manual.dir> |
| 40 | <manual>${manual.dir}/manual-${project.version}</manual> |
| 41 | <svn.root>${project.scm.connection}</svn.root> |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 42 | </properties> |
| 43 | |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 44 | <build> |
| 45 | <plugins> |
| 46 | |
| 47 | <plugin> |
| 48 | <artifactId>maven-antrun-plugin</artifactId> |
| 49 | <version>1.2</version> |
| 50 | <executions> |
| 51 | <execution> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 52 | <id>preprocess</id> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 53 | <configuration> |
| 54 | <tasks> |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 55 | <taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" classpathref="maven.plugin.classpath"/> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 56 | <taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" classpathref="maven.plugin.classpath"/> |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 57 | <taskdef name="trycatch" classname="net.sf.antcontrib.logic.TryCatchTask" classpathref="maven.plugin.classpath"/> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 58 | <property name="ant.regexp.regexpimpl" value="org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp" /> |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 59 | <mkdir dir="${manual.dir}"/> |
| 60 | <trycatch property="error"> |
| 61 | <try> |
| 62 | <get src="http://cwiki.apache.org/confluence/display/FELIX/Karaf+Users%27+Guide+in+one+page" |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 63 | dest="${manual}.temp" /> |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 64 | <for list="1,2,3,4,5,6,7,8,9,10" param="letter"> |
| 65 | <sequential> |
| 66 | <replaceregexp |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 67 | file="${manual}.temp" |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 68 | flags="g" |
| 69 | match='"/confluence/display/FELIX/([^"]*)\+([^"+]*)"' |
| 70 | replace='"/confluence/display/FELIX/\1\2"' /> |
| 71 | </sequential> |
| 72 | </for> |
| 73 | <replaceregexp |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 74 | file="${manual}.temp" |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 75 | flags="g" |
| 76 | match='"/confluence/display/FELIX/([^"]*)"' |
| 77 | replace='"#KarafUsers%27Guideinonepage-\1"' /> |
| 78 | <replaceregexp |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 79 | file="${manual}.temp" |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 80 | flags="g" |
| 81 | match='"/confluence/([^"]*)"' |
| 82 | replace='"http://cwiki.apache.org/confluence/\1"' /> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 83 | <replaceregexp |
| 84 | file="${manual}.temp" |
| 85 | flags="g" |
| 86 | match='>top</a>' |
| 87 | replace='></a>' /> |
| 88 | <java classname="org.ccil.cowan.tagsoup.CommandLine" |
| 89 | classpathref="maven.plugin.classpath" |
| 90 | fork="true" |
| 91 | output="${manual}.temp2" |
| 92 | logError="true"> |
| 93 | <arg value="${manual}.temp" /> |
| 94 | </java> |
| 95 | <xslt in="${manual}.temp2" out="${manual}.html" |
| 96 | style="${basedir}/src/xslt/extract.xsl"> |
| 97 | <param name="stylesheet" expression="${basedir}/src/styles/print.css"/> |
| 98 | </xslt> |
| 99 | <exec executable="prince"> |
| 100 | <arg value="${manual}.html"/> |
| 101 | <arg value="${manual}.pdf"/> |
| 102 | </exec> |
| 103 | <replace file="${manual}.html" |
| 104 | token="${basedir}/src/styles/print.css" |
| 105 | value="${svn.root}/src/styles/print.css" /> |
| 106 | <replace file="${manual}.html" token="scm:svn:" value="" /> |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 107 | </try> |
| 108 | <catch> |
| 109 | <if> |
| 110 | <equals arg1="${must-succeed}" arg2="true"/> |
| 111 | <then> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 112 | <echo>ERROR: ${error}</echo> |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 113 | <fail>${error}</fail> |
| 114 | </then> |
| 115 | <else> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 116 | <echo>ERROR: ${error}</echo> |
| 117 | <echo>Falling back to dummy manuals</echo> |
| 118 | <copy file="src/fallback/manual.html" tofile="${manual}.html" /> |
| 119 | <copy file="src/fallback/manual.pdf" tofile="${manual}.pdf" /> |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 120 | </else> |
| 121 | </if> |
| 122 | </catch> |
| 123 | </trycatch> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 124 | </tasks> |
| 125 | </configuration> |
| 126 | <goals> |
| 127 | <goal>run</goal> |
| 128 | </goals> |
| 129 | <phase>generate-resources</phase> |
| 130 | </execution> |
| 131 | </executions> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 132 | </plugin> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 133 | |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 134 | <plugin> |
| 135 | <groupId>org.codehaus.mojo</groupId> |
| 136 | <artifactId>build-helper-maven-plugin</artifactId> |
| 137 | <executions> |
| 138 | <execution> |
| 139 | <id>attach-artifacts</id> |
| 140 | <phase>package</phase> |
| 141 | <goals> |
| 142 | <goal>attach-artifact</goal> |
| 143 | </goals> |
| 144 | <configuration> |
| 145 | <artifacts> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 146 | <artifact> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 147 | <file>${manual}.html</file> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 148 | <type>html</type> |
| 149 | </artifact> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 150 | <artifact> |
| 151 | <file>${manual}.pdf</file> |
| 152 | <type>pdf</type> |
| 153 | </artifact> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 154 | </artifacts> |
| 155 | </configuration> |
| 156 | </execution> |
| 157 | </executions> |
| 158 | </plugin> |
| 159 | </plugins> |
| 160 | </build> |
| 161 | |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 162 | <profiles> |
| 163 | <profile> |
| 164 | <id>release</id> |
| 165 | <properties> |
| 166 | <must-succeed>true</must-succeed> |
| 167 | </properties> |
| 168 | </profile> |
| 169 | </profiles> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 170 | |
| 171 | </project> |