blob: 5299a308c7503df3617c62b1af4cea6684ba3926 [file] [log] [blame]
Filippo Diotalevif9ecbd62009-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 Custinefefbcf62010-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 Diotalevif9ecbd62009-10-13 12:55:35 +000019
20 <parent>
21 <groupId>org.apache.felix.karaf</groupId>
22 <artifactId>karaf</artifactId>
Guillaume Nodet5cf28132010-06-14 10:04:28 +000023 <version>1.7.0-SNAPSHOT</version>
Filippo Diotalevif9ecbd62009-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 Nodet5cf28132010-06-14 10:04:28 +000029 <version>1.7.0-SNAPSHOT</version>
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +000030 <packaging>pom</packaging>
Guillaume Nodetd4e20272009-10-14 11:44:17 +000031 <name>Apache Felix Karaf :: Manual</name>
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +000032 <description>The Karaf Manual which generates a HTML and PDF representation of the manual.</description>
33
Guillaume Nodetab7eaf22009-10-13 14:49:53 +000034 <properties>
35 <must-succeed>false</must-succeed>
Guillaume Nodetc5050bd2009-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 Nodetab7eaf22009-10-13 14:49:53 +000040 </properties>
41
Filippo Diotalevif9ecbd62009-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 Nodetc5050bd2009-10-16 09:35:27 +000050 <id>preprocess</id>
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +000051 <configuration>
52 <tasks>
Guillaume Nodet6f49a402009-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 Diotalevif9ecbd62009-10-13 12:55:35 +000056 <property name="ant.regexp.regexpimpl" value="org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp" />
Guillaume Nodet6f49a402009-11-27 12:27:23 +000057 <mkdir dir="${manual.dir}" />
Guillaume Nodetab7eaf22009-10-13 14:49:53 +000058 <trycatch property="error">
59 <try>
Guillaume Nodete541dcf2010-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 Nodetab7eaf22009-10-13 14:49:53 +000061 <for list="1,2,3,4,5,6,7,8,9,10" param="letter">
62 <sequential>
Guillaume Nodet6f49a402009-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 Nodetab7eaf22009-10-13 14:49:53 +000064 </sequential>
65 </for>
Guillaume Nodet6f49a402009-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 Nodetc5050bd2009-10-16 09:35:27 +000070 <arg value="${manual}.temp" />
71 </java>
Guillaume Nodet6f49a402009-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 Nodetc5050bd2009-10-16 09:35:27 +000074 </xslt>
75 <exec executable="prince">
Guillaume Nodet6f49a402009-11-27 12:27:23 +000076 <arg value="${manual}.html" />
77 <arg value="${manual}.pdf" />
Guillaume Nodetc5050bd2009-10-16 09:35:27 +000078 </exec>
Guillaume Nodet6f49a402009-11-27 12:27:23 +000079 <replace file="${manual}.html" token="${basedir}/src/styles/print.css" value="${svn.root}/src/styles/print.css" />
Guillaume Nodetc5050bd2009-10-16 09:35:27 +000080 <replace file="${manual}.html" token="scm:svn:" value="" />
Guillaume Nodetab7eaf22009-10-13 14:49:53 +000081 </try>
82 <catch>
83 <if>
Guillaume Nodet6f49a402009-11-27 12:27:23 +000084 <equals arg1="${must-succeed}" arg2="true" />
Guillaume Nodetab7eaf22009-10-13 14:49:53 +000085 <then>
Guillaume Nodetc5050bd2009-10-16 09:35:27 +000086 <echo>ERROR: ${error}</echo>
Guillaume Nodetab7eaf22009-10-13 14:49:53 +000087 <fail>${error}</fail>
88 </then>
89 <else>
Guillaume Nodetc5050bd2009-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 Nodetab7eaf22009-10-13 14:49:53 +000094 </else>
95 </if>
96 </catch>
97 </trycatch>
Filippo Diotalevif9ecbd62009-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 Diotalevif9ecbd62009-10-13 12:55:35 +0000106 </plugin>
Guillaume Nodetc5050bd2009-10-16 09:35:27 +0000107
Filippo Diotalevif9ecbd62009-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 Diotalevif9ecbd62009-10-13 12:55:35 +0000120 <artifact>
Guillaume Nodetc5050bd2009-10-16 09:35:27 +0000121 <file>${manual}.html</file>
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +0000122 <type>html</type>
123 </artifact>
Guillaume Nodetc5050bd2009-10-16 09:35:27 +0000124 <artifact>
125 <file>${manual}.pdf</file>
126 <type>pdf</type>
127 </artifact>
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +0000128 </artifacts>
129 </configuration>
130 </execution>
131 </executions>
132 </plugin>
133 </plugins>
134 </build>
135
Guillaume Nodetab7eaf22009-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 Diotalevif9ecbd62009-10-13 12:55:35 +0000144
Guillaume Nodet6f49a402009-11-27 12:27:23 +0000145</project>