Filippo Diotalevi | f9ecbd6 | 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"> |
Chris Custine | fefbcf6 | 2010-03-01 05:08:57 +0000 | [diff] [blame] | 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 | --> |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 19 | |
| 20 | <parent> |
| 21 | <groupId>org.apache.felix.karaf</groupId> |
| 22 | <artifactId>karaf</artifactId> |
Chris Custine | 130ecdd | 2010-02-19 07:50:10 +0000 | [diff] [blame] | 23 | <version>1.5.0-SNAPSHOT</version> |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 24 | </parent> |
| 25 | |
| 26 | <modelVersion>4.0.0</modelVersion> |
| 27 | <groupId>org.apache.felix.karaf</groupId> |
| 28 | <artifactId>manual</artifactId> |
Chris Custine | 130ecdd | 2010-02-19 07:50:10 +0000 | [diff] [blame] | 29 | <version>1.5.0-SNAPSHOT</version> |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 30 | <packaging>pom</packaging> |
Guillaume Nodet | d4e2027 | 2009-10-14 11:44:17 +0000 | [diff] [blame] | 31 | <name>Apache Felix Karaf :: Manual</name> |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 32 | <description>The Karaf Manual which generates a HTML and PDF representation of the manual.</description> |
| 33 | |
Guillaume Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 34 | <properties> |
| 35 | <must-succeed>false</must-succeed> |
Guillaume Nodet | c5050bd | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 36 | |
| 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 Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 40 | </properties> |
| 41 | |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 42 | <build> |
| 43 | <plugins> |
| 44 | |
| 45 | <plugin> |
| 46 | <artifactId>maven-antrun-plugin</artifactId> |
| 47 | <version>1.2</version> |
| 48 | <executions> |
| 49 | <execution> |
Guillaume Nodet | c5050bd | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 50 | <id>preprocess</id> |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 51 | <configuration> |
| 52 | <tasks> |
Guillaume Nodet | 6f49a40 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 53 | <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 Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 56 | <property name="ant.regexp.regexpimpl" value="org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp" /> |
Guillaume Nodet | 6f49a40 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 57 | <mkdir dir="${manual.dir}" /> |
Guillaume Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 58 | <trycatch property="error"> |
| 59 | <try> |
Guillaume Nodet | 6f49a40 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 60 | <get src="http://cwiki.apache.org/confluence/display/FELIX/Karaf+Users%27+Guide+in+one+page" dest="${manual}.temp" /> |
Guillaume Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 61 | <for list="1,2,3,4,5,6,7,8,9,10" param="letter"> |
| 62 | <sequential> |
Guillaume Nodet | 6f49a40 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 63 | <replaceregexp file="${manual}.temp" flags="g" match=""/confluence/display/FELIX/([^"]*)\+([^"+]*)"" replace=""/confluence/display/FELIX/\1\2"" /> |
Guillaume Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 64 | </sequential> |
| 65 | </for> |
Guillaume Nodet | 6f49a40 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 66 | <replaceregexp file="${manual}.temp" flags="g" match=""/confluence/display/FELIX/([^"]*)"" replace=""#KarafUsers%27Guideinonepage-\1"" /> |
| 67 | <replaceregexp file="${manual}.temp" flags="g" match=""/confluence/([^"]*)"" replace=""http://cwiki.apache.org/confluence/\1"" /> |
| 68 | <replaceregexp file="${manual}.temp" flags="g" match=">top</a>" replace="></a>" /> |
| 69 | <java classname="org.ccil.cowan.tagsoup.CommandLine" classpathref="maven.plugin.classpath" fork="true" output="${manual}.temp2" logError="true"> |
Guillaume Nodet | c5050bd | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 70 | <arg value="${manual}.temp" /> |
| 71 | </java> |
Guillaume Nodet | 6f49a40 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 72 | <xslt in="${manual}.temp2" out="${manual}.html" style="${basedir}/src/xslt/extract.xsl"> |
| 73 | <param name="stylesheet" expression="${basedir}/src/styles/print.css" /> |
Guillaume Nodet | c5050bd | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 74 | </xslt> |
| 75 | <exec executable="prince"> |
Guillaume Nodet | 6f49a40 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 76 | <arg value="${manual}.html" /> |
| 77 | <arg value="${manual}.pdf" /> |
Guillaume Nodet | c5050bd | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 78 | </exec> |
Guillaume Nodet | 6f49a40 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 79 | <replace file="${manual}.html" token="${basedir}/src/styles/print.css" value="${svn.root}/src/styles/print.css" /> |
Guillaume Nodet | c5050bd | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 80 | <replace file="${manual}.html" token="scm:svn:" value="" /> |
Guillaume Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 81 | </try> |
| 82 | <catch> |
| 83 | <if> |
Guillaume Nodet | 6f49a40 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 84 | <equals arg1="${must-succeed}" arg2="true" /> |
Guillaume Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 85 | <then> |
Guillaume Nodet | c5050bd | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 86 | <echo>ERROR: ${error}</echo> |
Guillaume Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 87 | <fail>${error}</fail> |
| 88 | </then> |
| 89 | <else> |
Guillaume Nodet | c5050bd | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 90 | <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 Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 94 | </else> |
| 95 | </if> |
| 96 | </catch> |
| 97 | </trycatch> |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 98 | </tasks> |
| 99 | </configuration> |
| 100 | <goals> |
| 101 | <goal>run</goal> |
| 102 | </goals> |
| 103 | <phase>generate-resources</phase> |
| 104 | </execution> |
| 105 | </executions> |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 106 | </plugin> |
Guillaume Nodet | c5050bd | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 107 | |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 108 | <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 Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 120 | <artifact> |
Guillaume Nodet | c5050bd | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 121 | <file>${manual}.html</file> |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 122 | <type>html</type> |
| 123 | </artifact> |
Guillaume Nodet | c5050bd | 2009-10-16 09:35:27 +0000 | [diff] [blame] | 124 | <artifact> |
| 125 | <file>${manual}.pdf</file> |
| 126 | <type>pdf</type> |
| 127 | </artifact> |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 128 | </artifacts> |
| 129 | </configuration> |
| 130 | </execution> |
| 131 | </executions> |
| 132 | </plugin> |
| 133 | </plugins> |
| 134 | </build> |
| 135 | |
Guillaume Nodet | ab7eaf2 | 2009-10-13 14:49:53 +0000 | [diff] [blame] | 136 | <profiles> |
| 137 | <profile> |
| 138 | <id>release</id> |
| 139 | <properties> |
| 140 | <must-succeed>true</must-succeed> |
| 141 | </properties> |
| 142 | </profile> |
| 143 | </profiles> |
Filippo Diotalevi | f9ecbd6 | 2009-10-13 12:55:35 +0000 | [diff] [blame] | 144 | |
Guillaume Nodet | 6f49a40 | 2009-11-27 12:27:23 +0000 | [diff] [blame] | 145 | </project> |