Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 1 | <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> |
Guillaume Nodet | 1432d50 | 2009-11-27 12:32:26 +0000 | [diff] [blame] | 6 | <version>1.3.0-SNAPSHOT</version> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 7 | </parent> |
| 8 | |
| 9 | <modelVersion>4.0.0</modelVersion> |
| 10 | <groupId>org.apache.felix.karaf</groupId> |
| 11 | <artifactId>manual</artifactId> |
Guillaume Nodet | 1432d50 | 2009-11-27 12:32:26 +0000 | [diff] [blame] | 12 | <version>1.3.0-SNAPSHOT</version> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 13 | <packaging>pom</packaging> |
Guillaume Nodet | 276a750 | 2009-10-14 11:44:17 +0000 | [diff] [blame] | 14 | <name>Apache Felix Karaf :: Manual</name> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 15 | <description>The Karaf Manual which generates a HTML and PDF representation of the manual.</description> |
| 16 | |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 17 | <properties> |
| 18 | <must-succeed>false</must-succeed> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 19 | |
| 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 Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 23 | </properties> |
| 24 | |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 25 | <build> |
| 26 | <plugins> |
| 27 | |
| 28 | <plugin> |
| 29 | <artifactId>maven-antrun-plugin</artifactId> |
| 30 | <version>1.2</version> |
| 31 | <executions> |
| 32 | <execution> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 33 | <id>preprocess</id> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 34 | <configuration> |
| 35 | <tasks> |
Guillaume Nodet | 788f6c0 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 36 | <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 Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 39 | <property name="ant.regexp.regexpimpl" value="org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp" /> |
Guillaume Nodet | 788f6c0 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 40 | <mkdir dir="${manual.dir}" /> |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 41 | <trycatch property="error"> |
| 42 | <try> |
Guillaume Nodet | 788f6c0 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 43 | <get src="http://cwiki.apache.org/confluence/display/FELIX/Karaf+Users%27+Guide+in+one+page" dest="${manual}.temp" /> |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 44 | <for list="1,2,3,4,5,6,7,8,9,10" param="letter"> |
| 45 | <sequential> |
Guillaume Nodet | 788f6c0 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 46 | <replaceregexp file="${manual}.temp" flags="g" match=""/confluence/display/FELIX/([^"]*)\+([^"+]*)"" replace=""/confluence/display/FELIX/\1\2"" /> |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 47 | </sequential> |
| 48 | </for> |
Guillaume Nodet | 788f6c0 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 49 | <replaceregexp file="${manual}.temp" flags="g" match=""/confluence/display/FELIX/([^"]*)"" replace=""#KarafUsers%27Guideinonepage-\1"" /> |
| 50 | <replaceregexp file="${manual}.temp" flags="g" match=""/confluence/([^"]*)"" replace=""http://cwiki.apache.org/confluence/\1"" /> |
| 51 | <replaceregexp file="${manual}.temp" flags="g" match=">top</a>" replace="></a>" /> |
| 52 | <java classname="org.ccil.cowan.tagsoup.CommandLine" classpathref="maven.plugin.classpath" fork="true" output="${manual}.temp2" logError="true"> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 53 | <arg value="${manual}.temp" /> |
| 54 | </java> |
Guillaume Nodet | 788f6c0 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 55 | <xslt in="${manual}.temp2" out="${manual}.html" style="${basedir}/src/xslt/extract.xsl"> |
| 56 | <param name="stylesheet" expression="${basedir}/src/styles/print.css" /> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 57 | </xslt> |
| 58 | <exec executable="prince"> |
Guillaume Nodet | 788f6c0 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 59 | <arg value="${manual}.html" /> |
| 60 | <arg value="${manual}.pdf" /> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 61 | </exec> |
Guillaume Nodet | 788f6c0 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 62 | <replace file="${manual}.html" token="${basedir}/src/styles/print.css" value="${svn.root}/src/styles/print.css" /> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 63 | <replace file="${manual}.html" token="scm:svn:" value="" /> |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 64 | </try> |
| 65 | <catch> |
| 66 | <if> |
Guillaume Nodet | 788f6c0 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 67 | <equals arg1="${must-succeed}" arg2="true" /> |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 68 | <then> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 69 | <echo>ERROR: ${error}</echo> |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 70 | <fail>${error}</fail> |
| 71 | </then> |
| 72 | <else> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 73 | <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 Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 77 | </else> |
| 78 | </if> |
| 79 | </catch> |
| 80 | </trycatch> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 81 | </tasks> |
| 82 | </configuration> |
| 83 | <goals> |
| 84 | <goal>run</goal> |
| 85 | </goals> |
| 86 | <phase>generate-resources</phase> |
| 87 | </execution> |
| 88 | </executions> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 89 | </plugin> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 90 | |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 91 | <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 Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 103 | <artifact> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 104 | <file>${manual}.html</file> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 105 | <type>html</type> |
| 106 | </artifact> |
Guillaume Nodet | f06efd9 | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 107 | <artifact> |
| 108 | <file>${manual}.pdf</file> |
| 109 | <type>pdf</type> |
| 110 | </artifact> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 111 | </artifacts> |
| 112 | </configuration> |
| 113 | </execution> |
| 114 | </executions> |
| 115 | </plugin> |
| 116 | </plugins> |
| 117 | </build> |
| 118 | |
Guillaume Nodet | b8111a5 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 119 | <profiles> |
| 120 | <profile> |
| 121 | <id>release</id> |
| 122 | <properties> |
| 123 | <must-succeed>true</must-succeed> |
| 124 | </properties> |
| 125 | </profile> |
| 126 | </profiles> |
Filippo Diotalevi | b4c8e3e | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 127 | |
Guillaume Nodet | 788f6c0 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 128 | </project> |