blob: 5299a308c7503df3617c62b1af4cea6684ba3926 [file] [log] [blame]
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +00001<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">
Chris Custine5294c4e2010-03-01 05:08:57 +00002<!--
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-->
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +000019
20 <parent>
21 <groupId>org.apache.felix.karaf</groupId>
22 <artifactId>karaf</artifactId>
Guillaume Nodete21429b2010-05-20 20:08:17 +000023 <version>1.7.0-SNAPSHOT</version>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +000024 </parent>
25
26 <modelVersion>4.0.0</modelVersion>
27 <groupId>org.apache.felix.karaf</groupId>
28 <artifactId>manual</artifactId>
Guillaume Nodete21429b2010-05-20 20:08:17 +000029 <version>1.7.0-SNAPSHOT</version>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +000030 <packaging>pom</packaging>
Guillaume Nodet276a7502009-10-14 11:44:17 +000031 <name>Apache Felix Karaf :: Manual</name>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +000032 <description>The Karaf Manual which generates a HTML and PDF representation of the manual.</description>
33
Guillaume Nodetb8111a52009-10-13 14:49:53 +000034 <properties>
35 <must-succeed>false</must-succeed>
Guillaume Nodetf06efd92009-10-16 09:35:27 +000036
37 <manual.dir>${project.build.directory}/manual</manual.dir>
38 <manual>${manual.dir}/manual-${project.version}</manual>
39 <svn.root>${project.scm.connection}</svn.root>
Guillaume Nodetb8111a52009-10-13 14:49:53 +000040 </properties>
41
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +000042 <build>
43 <plugins>
44
45 <plugin>
46 <artifactId>maven-antrun-plugin</artifactId>
47 <version>1.2</version>
48 <executions>
49 <execution>
Guillaume Nodetf06efd92009-10-16 09:35:27 +000050 <id>preprocess</id>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +000051 <configuration>
52 <tasks>
Guillaume Nodet788f6c02009-11-27 12:27:23 +000053 <taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" classpathref="maven.plugin.classpath" />
54 <taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" classpathref="maven.plugin.classpath" />
55 <taskdef name="trycatch" classname="net.sf.antcontrib.logic.TryCatchTask" classpathref="maven.plugin.classpath" />
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +000056 <property name="ant.regexp.regexpimpl" value="org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp" />
Guillaume Nodet788f6c02009-11-27 12:27:23 +000057 <mkdir dir="${manual.dir}" />
Guillaume Nodetb8111a52009-10-13 14:49:53 +000058 <trycatch property="error">
59 <try>
Guillaume Nodet1ec14fe2010-05-19 21:52:19 +000060 <get src="https://cwiki.apache.org/confluence/display/FELIX/Karaf+Users'+Guide+in+one+page" dest="${manual}.temp" />
Guillaume Nodetb8111a52009-10-13 14:49:53 +000061 <for list="1,2,3,4,5,6,7,8,9,10" param="letter">
62 <sequential>
Guillaume Nodet788f6c02009-11-27 12:27:23 +000063 <replaceregexp file="${manual}.temp" flags="g" match="&quot;/confluence/display/FELIX/([^&quot;]*)\+([^&quot;+]*)&quot;" replace="&quot;/confluence/display/FELIX/\1\2&quot;" />
Guillaume Nodetb8111a52009-10-13 14:49:53 +000064 </sequential>
65 </for>
Guillaume Nodet788f6c02009-11-27 12:27:23 +000066 <replaceregexp file="${manual}.temp" flags="g" match="&quot;/confluence/display/FELIX/([^&quot;]*)&quot;" replace="&quot;#KarafUsers%27Guideinonepage-\1&quot;" />
67 <replaceregexp file="${manual}.temp" flags="g" match="&quot;/confluence/([^&quot;]*)&quot;" replace="&quot;http://cwiki.apache.org/confluence/\1&quot;" />
68 <replaceregexp file="${manual}.temp" flags="g" match="&gt;top&lt;/a&gt;" replace="&gt;&lt;/a&gt;" />
69 <java classname="org.ccil.cowan.tagsoup.CommandLine" classpathref="maven.plugin.classpath" fork="true" output="${manual}.temp2" logError="true">
Guillaume Nodetf06efd92009-10-16 09:35:27 +000070 <arg value="${manual}.temp" />
71 </java>
Guillaume Nodet788f6c02009-11-27 12:27:23 +000072 <xslt in="${manual}.temp2" out="${manual}.html" style="${basedir}/src/xslt/extract.xsl">
73 <param name="stylesheet" expression="${basedir}/src/styles/print.css" />
Guillaume Nodetf06efd92009-10-16 09:35:27 +000074 </xslt>
75 <exec executable="prince">
Guillaume Nodet788f6c02009-11-27 12:27:23 +000076 <arg value="${manual}.html" />
77 <arg value="${manual}.pdf" />
Guillaume Nodetf06efd92009-10-16 09:35:27 +000078 </exec>
Guillaume Nodet788f6c02009-11-27 12:27:23 +000079 <replace file="${manual}.html" token="${basedir}/src/styles/print.css" value="${svn.root}/src/styles/print.css" />
Guillaume Nodetf06efd92009-10-16 09:35:27 +000080 <replace file="${manual}.html" token="scm:svn:" value="" />
Guillaume Nodetb8111a52009-10-13 14:49:53 +000081 </try>
82 <catch>
83 <if>
Guillaume Nodet788f6c02009-11-27 12:27:23 +000084 <equals arg1="${must-succeed}" arg2="true" />
Guillaume Nodetb8111a52009-10-13 14:49:53 +000085 <then>
Guillaume Nodetf06efd92009-10-16 09:35:27 +000086 <echo>ERROR: ${error}</echo>
Guillaume Nodetb8111a52009-10-13 14:49:53 +000087 <fail>${error}</fail>
88 </then>
89 <else>
Guillaume Nodetf06efd92009-10-16 09:35:27 +000090 <echo>ERROR: ${error}</echo>
91 <echo>Falling back to dummy manuals</echo>
92 <copy file="src/fallback/manual.html" tofile="${manual}.html" />
93 <copy file="src/fallback/manual.pdf" tofile="${manual}.pdf" />
Guillaume Nodetb8111a52009-10-13 14:49:53 +000094 </else>
95 </if>
96 </catch>
97 </trycatch>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +000098 </tasks>
99 </configuration>
100 <goals>
101 <goal>run</goal>
102 </goals>
103 <phase>generate-resources</phase>
104 </execution>
105 </executions>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +0000106 </plugin>
Guillaume Nodetf06efd92009-10-16 09:35:27 +0000107
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +0000108 <plugin>
109 <groupId>org.codehaus.mojo</groupId>
110 <artifactId>build-helper-maven-plugin</artifactId>
111 <executions>
112 <execution>
113 <id>attach-artifacts</id>
114 <phase>package</phase>
115 <goals>
116 <goal>attach-artifact</goal>
117 </goals>
118 <configuration>
119 <artifacts>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +0000120 <artifact>
Guillaume Nodetf06efd92009-10-16 09:35:27 +0000121 <file>${manual}.html</file>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +0000122 <type>html</type>
123 </artifact>
Guillaume Nodetf06efd92009-10-16 09:35:27 +0000124 <artifact>
125 <file>${manual}.pdf</file>
126 <type>pdf</type>
127 </artifact>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +0000128 </artifacts>
129 </configuration>
130 </execution>
131 </executions>
132 </plugin>
133 </plugins>
134 </build>
135
Guillaume Nodetb8111a52009-10-13 14:49:53 +0000136 <profiles>
137 <profile>
138 <id>release</id>
139 <properties>
140 <must-succeed>true</must-succeed>
141 </properties>
142 </profile>
143 </profiles>
Filippo Diotalevib4c8e3e2009-10-13 12:55:35 +0000144
Guillaume Nodet788f6c02009-11-27 12:27:23 +0000145</project>