blob: 749e11fb8c198588c8513e1c43b5febf04b29dcb [file] [log] [blame]
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +00001<?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 Nodet276a7502009-10-14 11:44:17 +000033 <name>Apache Felix Karaf :: Manual</name>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +000034 <description>The Karaf Manual which generates a HTML and PDF representation of the manual.</description>
35
Guillaume Nodetb8111a52009-10-13 14:49:53 +000036 <properties>
37 <must-succeed>false</must-succeed>
Guillaume Nodetf06efd92009-10-16 09:35:27 +000038
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 Nodetb8111a52009-10-13 14:49:53 +000042 </properties>
43
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +000044 <build>
45 <plugins>
46
47 <plugin>
48 <artifactId>maven-antrun-plugin</artifactId>
49 <version>1.2</version>
50 <executions>
51 <execution>
Guillaume Nodetf06efd92009-10-16 09:35:27 +000052 <id>preprocess</id>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +000053 <configuration>
54 <tasks>
Guillaume Nodetb8111a52009-10-13 14:49:53 +000055 <taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" classpathref="maven.plugin.classpath"/>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +000056 <taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" classpathref="maven.plugin.classpath"/>
Guillaume Nodetb8111a52009-10-13 14:49:53 +000057 <taskdef name="trycatch" classname="net.sf.antcontrib.logic.TryCatchTask" classpathref="maven.plugin.classpath"/>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +000058 <property name="ant.regexp.regexpimpl" value="org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp" />
Guillaume Nodetb8111a52009-10-13 14:49:53 +000059 <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 Nodetf06efd92009-10-16 09:35:27 +000063 dest="${manual}.temp" />
Guillaume Nodetb8111a52009-10-13 14:49:53 +000064 <for list="1,2,3,4,5,6,7,8,9,10" param="letter">
65 <sequential>
66 <replaceregexp
Guillaume Nodetf06efd92009-10-16 09:35:27 +000067 file="${manual}.temp"
Guillaume Nodetb8111a52009-10-13 14:49:53 +000068 flags="g"
69 match='"/confluence/display/FELIX/([^"]*)\+([^"+]*)"'
70 replace='"/confluence/display/FELIX/\1\2"' />
71 </sequential>
72 </for>
73 <replaceregexp
Guillaume Nodetf06efd92009-10-16 09:35:27 +000074 file="${manual}.temp"
Guillaume Nodetb8111a52009-10-13 14:49:53 +000075 flags="g"
76 match='"/confluence/display/FELIX/([^"]*)"'
77 replace='"#KarafUsers%27Guideinonepage-\1"' />
78 <replaceregexp
Guillaume Nodetf06efd92009-10-16 09:35:27 +000079 file="${manual}.temp"
Guillaume Nodetb8111a52009-10-13 14:49:53 +000080 flags="g"
81 match='"/confluence/([^"]*)"'
82 replace='"http://cwiki.apache.org/confluence/\1"' />
Guillaume Nodetf06efd92009-10-16 09:35:27 +000083 <replaceregexp
84 file="${manual}.temp"
85 flags="g"
86 match='&gt;top&lt;/a&gt;'
87 replace='&gt;&lt;/a&gt;' />
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 Nodetb8111a52009-10-13 14:49:53 +0000107 </try>
108 <catch>
109 <if>
110 <equals arg1="${must-succeed}" arg2="true"/>
111 <then>
Guillaume Nodetf06efd92009-10-16 09:35:27 +0000112 <echo>ERROR: ${error}</echo>
Guillaume Nodetb8111a52009-10-13 14:49:53 +0000113 <fail>${error}</fail>
114 </then>
115 <else>
Guillaume Nodetf06efd92009-10-16 09:35:27 +0000116 <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 Nodetb8111a52009-10-13 14:49:53 +0000120 </else>
121 </if>
122 </catch>
123 </trycatch>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +0000124 </tasks>
125 </configuration>
126 <goals>
127 <goal>run</goal>
128 </goals>
129 <phase>generate-resources</phase>
130 </execution>
131 </executions>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +0000132 </plugin>
Guillaume Nodetf06efd92009-10-16 09:35:27 +0000133
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +0000134 <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 Diotalevib4c8e3e2009-10-13 12:55:35 +0000146 <artifact>
Guillaume Nodetf06efd92009-10-16 09:35:27 +0000147 <file>${manual}.html</file>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +0000148 <type>html</type>
149 </artifact>
Guillaume Nodetf06efd92009-10-16 09:35:27 +0000150 <artifact>
151 <file>${manual}.pdf</file>
152 <type>pdf</type>
153 </artifact>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +0000154 </artifacts>
155 </configuration>
156 </execution>
157 </executions>
158 </plugin>
159 </plugins>
160 </build>
161
Guillaume Nodetb8111a52009-10-13 14:49:53 +0000162 <profiles>
163 <profile>
164 <id>release</id>
165 <properties>
166 <must-succeed>true</must-succeed>
167 </properties>
168 </profile>
169 </profiles>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +0000170
171</project>