blob: f5033ab1146f6b637d40a610c4be44c5e1dc17a5 [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">
2
3 <parent>
4 <groupId>org.apache.felix.karaf</groupId>
5 <artifactId>karaf</artifactId>
Chris Custine130ecdd2010-02-19 07:50:10 +00006 <version>1.5.0-SNAPSHOT</version>
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +00007 </parent>
8
9 <modelVersion>4.0.0</modelVersion>
10 <groupId>org.apache.felix.karaf</groupId>
11 <artifactId>manual</artifactId>
Chris Custine130ecdd2010-02-19 07:50:10 +000012 <version>1.5.0-SNAPSHOT</version>
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +000013 <packaging>pom</packaging>
Guillaume Nodetd4e20272009-10-14 11:44:17 +000014 <name>Apache Felix Karaf :: Manual</name>
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +000015 <description>The Karaf Manual which generates a HTML and PDF representation of the manual.</description>
16
Guillaume Nodetab7eaf22009-10-13 14:49:53 +000017 <properties>
18 <must-succeed>false</must-succeed>
Guillaume Nodetc5050bd2009-10-16 09:35:27 +000019
20 <manual.dir>${project.build.directory}/manual</manual.dir>
21 <manual>${manual.dir}/manual-${project.version}</manual>
22 <svn.root>${project.scm.connection}</svn.root>
Guillaume Nodetab7eaf22009-10-13 14:49:53 +000023 </properties>
24
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +000025 <build>
26 <plugins>
27
28 <plugin>
29 <artifactId>maven-antrun-plugin</artifactId>
30 <version>1.2</version>
31 <executions>
32 <execution>
Guillaume Nodetc5050bd2009-10-16 09:35:27 +000033 <id>preprocess</id>
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +000034 <configuration>
35 <tasks>
Guillaume Nodet6f49a402009-11-27 12:27:23 +000036 <taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" classpathref="maven.plugin.classpath" />
37 <taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" classpathref="maven.plugin.classpath" />
38 <taskdef name="trycatch" classname="net.sf.antcontrib.logic.TryCatchTask" classpathref="maven.plugin.classpath" />
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +000039 <property name="ant.regexp.regexpimpl" value="org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp" />
Guillaume Nodet6f49a402009-11-27 12:27:23 +000040 <mkdir dir="${manual.dir}" />
Guillaume Nodetab7eaf22009-10-13 14:49:53 +000041 <trycatch property="error">
42 <try>
Guillaume Nodet6f49a402009-11-27 12:27:23 +000043 <get src="http://cwiki.apache.org/confluence/display/FELIX/Karaf+Users%27+Guide+in+one+page" dest="${manual}.temp" />
Guillaume Nodetab7eaf22009-10-13 14:49:53 +000044 <for list="1,2,3,4,5,6,7,8,9,10" param="letter">
45 <sequential>
Guillaume Nodet6f49a402009-11-27 12:27:23 +000046 <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 +000047 </sequential>
48 </for>
Guillaume Nodet6f49a402009-11-27 12:27:23 +000049 <replaceregexp file="${manual}.temp" flags="g" match="&quot;/confluence/display/FELIX/([^&quot;]*)&quot;" replace="&quot;#KarafUsers%27Guideinonepage-\1&quot;" />
50 <replaceregexp file="${manual}.temp" flags="g" match="&quot;/confluence/([^&quot;]*)&quot;" replace="&quot;http://cwiki.apache.org/confluence/\1&quot;" />
51 <replaceregexp file="${manual}.temp" flags="g" match="&gt;top&lt;/a&gt;" replace="&gt;&lt;/a&gt;" />
52 <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 +000053 <arg value="${manual}.temp" />
54 </java>
Guillaume Nodet6f49a402009-11-27 12:27:23 +000055 <xslt in="${manual}.temp2" out="${manual}.html" style="${basedir}/src/xslt/extract.xsl">
56 <param name="stylesheet" expression="${basedir}/src/styles/print.css" />
Guillaume Nodetc5050bd2009-10-16 09:35:27 +000057 </xslt>
58 <exec executable="prince">
Guillaume Nodet6f49a402009-11-27 12:27:23 +000059 <arg value="${manual}.html" />
60 <arg value="${manual}.pdf" />
Guillaume Nodetc5050bd2009-10-16 09:35:27 +000061 </exec>
Guillaume Nodet6f49a402009-11-27 12:27:23 +000062 <replace file="${manual}.html" token="${basedir}/src/styles/print.css" value="${svn.root}/src/styles/print.css" />
Guillaume Nodetc5050bd2009-10-16 09:35:27 +000063 <replace file="${manual}.html" token="scm:svn:" value="" />
Guillaume Nodetab7eaf22009-10-13 14:49:53 +000064 </try>
65 <catch>
66 <if>
Guillaume Nodet6f49a402009-11-27 12:27:23 +000067 <equals arg1="${must-succeed}" arg2="true" />
Guillaume Nodetab7eaf22009-10-13 14:49:53 +000068 <then>
Guillaume Nodetc5050bd2009-10-16 09:35:27 +000069 <echo>ERROR: ${error}</echo>
Guillaume Nodetab7eaf22009-10-13 14:49:53 +000070 <fail>${error}</fail>
71 </then>
72 <else>
Guillaume Nodetc5050bd2009-10-16 09:35:27 +000073 <echo>ERROR: ${error}</echo>
74 <echo>Falling back to dummy manuals</echo>
75 <copy file="src/fallback/manual.html" tofile="${manual}.html" />
76 <copy file="src/fallback/manual.pdf" tofile="${manual}.pdf" />
Guillaume Nodetab7eaf22009-10-13 14:49:53 +000077 </else>
78 </if>
79 </catch>
80 </trycatch>
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +000081 </tasks>
82 </configuration>
83 <goals>
84 <goal>run</goal>
85 </goals>
86 <phase>generate-resources</phase>
87 </execution>
88 </executions>
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +000089 </plugin>
Guillaume Nodetc5050bd2009-10-16 09:35:27 +000090
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +000091 <plugin>
92 <groupId>org.codehaus.mojo</groupId>
93 <artifactId>build-helper-maven-plugin</artifactId>
94 <executions>
95 <execution>
96 <id>attach-artifacts</id>
97 <phase>package</phase>
98 <goals>
99 <goal>attach-artifact</goal>
100 </goals>
101 <configuration>
102 <artifacts>
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +0000103 <artifact>
Guillaume Nodetc5050bd2009-10-16 09:35:27 +0000104 <file>${manual}.html</file>
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +0000105 <type>html</type>
106 </artifact>
Guillaume Nodetc5050bd2009-10-16 09:35:27 +0000107 <artifact>
108 <file>${manual}.pdf</file>
109 <type>pdf</type>
110 </artifact>
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +0000111 </artifacts>
112 </configuration>
113 </execution>
114 </executions>
115 </plugin>
116 </plugins>
117 </build>
118
Guillaume Nodetab7eaf22009-10-13 14:49:53 +0000119 <profiles>
120 <profile>
121 <id>release</id>
122 <properties>
123 <must-succeed>true</must-succeed>
124 </properties>
125 </profile>
126 </profiles>
Filippo Diotalevif9ecbd62009-10-13 12:55:35 +0000127
Guillaume Nodet6f49a402009-11-27 12:27:23 +0000128</project>