From 688a34980bfa1eb93e9abe916f5918d4d3067160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trygve=20Laugst=C3=B8l?= Date: Wed, 20 Feb 2013 11:50:16 +0100 Subject: [PATCH] o Adding the filterFiles feature to the handbook. Related to issue #1. --- .../src/main/docbook/content/handbook.xml | 367 +++++++++++++----- 1 file changed, 266 insertions(+), 101 deletions(-) diff --git a/unix-handbook/src/main/docbook/content/handbook.xml b/unix-handbook/src/main/docbook/content/handbook.xml index d294ad5b..8ef86ad8 100644 --- a/unix-handbook/src/main/docbook/content/handbook.xml +++ b/unix-handbook/src/main/docbook/content/handbook.xml @@ -35,14 +35,12 @@ Trygve Laugstøl - - Arktekk AS - + - trygve.laugstol@arktekk.no + trygvis@inamo.no - $Id: handbook.xml 14315 2011-07-08 16:08:05Z trygvis $ + @@ -105,7 +103,7 @@ The book is under continous development and is written in parallel with the plugin. It will only document the current version until a stable - release is done. See on + release is done. See on how to upgrade from one version to the next version. Currently there are chapters and sections that serve as placeholders @@ -134,8 +132,8 @@ The Unix Maven Plugin is meant to fill in the gap between creating platform independent applications and reality. It makes it possible to create Java application with your standard Java - development stack, and still install the applications using - the native tools that your system administrators already know. + development stack, and still install the applications using the native + tools that your system administrators already know. As it automates yet another step in the development chain @@ -165,9 +163,9 @@ Metadata generation: Each package format contain some form of metadata that it uses when the package is being installed or - removed. The plugin will pick up as much metadata from the Maven POM - as possible, but there are certain options that might have to be - filled in, depending on the package format. + removed. The plugin will pick up as much metadata from the Maven + POM as possible, but there are certain options that might have to + be filled in, depending on the package format. @@ -224,8 +222,7 @@ After all the assembly operations has been executed, the physical package file will be created. - See also . + See also . @@ -442,7 +439,7 @@ <code>pom.xml</code> for the deb version + href="../examples/basic/pom-deb.xml" parse="text"/>
@@ -455,12 +452,12 @@ The package will contain these files: + href="../examples/basic/dpkg-deb-c.txt" parse="text"/> The generated control file: + href="../examples/basic/dpkg-deb-f.txt" parse="text"/>
@@ -471,7 +468,7 @@ <code>pom.xml</code> for the pkg version + href="../examples/basic/pom-pkg.xml" parse="text"/>
@@ -484,7 +481,7 @@ The generated metadata will look like this: + href="../examples/basic/pkginfo.txt" parse="text"/> Notice that the SNAPSHOT part of the version string has been replaced with the a timestamp. @@ -492,7 +489,7 @@ To see verify the paths and their attributes, run this: + href="../examples/basic/pkgchk.txt" parse="text"/>
@@ -503,7 +500,7 @@ <code>pom.xml</code> for RPM version + href="../examples/basic/pom-rpm.xml" parse="text"/>
@@ -516,7 +513,7 @@ The package will contain these files: + href="../examples/basic/rpm-qlp.txt" parse="text"/>
@@ -527,7 +524,7 @@ <code>pom.xml</code> for the zip version + href="../examples/basic/pom-zip.xml" parse="text"/>
@@ -539,7 +536,7 @@ The zip will contain these files: - +
@@ -591,8 +588,8 @@ When the plugin is collecting all relevant data for a package it collects all the information in a generic object called "package parameters". This object is used as the basis when the package is - created. See on how the package parameters - map to the format specific fields. + created. See on how the package parameters map + to the format specific fields. @@ -611,9 +608,9 @@ - + - + @@ -635,7 +632,7 @@ project.groupId - + @@ -645,7 +642,7 @@ project.artifactId - + @@ -656,7 +653,7 @@ Calculated This field is calculated from different sources. See - for details. + for details. @@ -667,7 +664,7 @@ mojo.revision This field is calculated from different sources unless - specified. See for + specified. See for details. @@ -724,7 +721,7 @@
- + @@ -734,7 +731,7 @@ mojo.contact - + @@ -744,7 +741,7 @@ mojo.contactEmail - + @@ -796,9 +793,9 @@ - + - + @@ -820,7 +817,7 @@ deb.priority - + @@ -830,7 +827,7 @@ deb.section - + @@ -863,9 +860,9 @@ - + - + @@ -887,7 +884,7 @@ rpm.group - + @@ -946,11 +943,11 @@ - + - + - + @@ -1065,11 +1062,11 @@ - + - + - + @@ -1194,7 +1191,7 @@ format - + @@ -1261,27 +1258,27 @@ Maintainer - + - + contactEmail - + EMAIL - + license - + - + License @@ -1293,7 +1290,7 @@ ARCH - + @@ -1317,7 +1314,7 @@
Rpm Specific Mappings - +
@@ -1346,7 +1343,7 @@ Naming convention for action scripts per format - + @@ -1433,9 +1430,9 @@ Naming convention for generic action scripts - + - + @@ -1512,7 +1509,7 @@ Summary of assembly operations - + @@ -1545,6 +1542,12 @@ Extracts an artifact from the repository + + Fitler file + + Filters a file + + Make directory @@ -1732,15 +1735,16 @@ Some assembly operations support both per-directory and per-file attributes. If so the outer tag will be named - <fileAttributes> and <directoryAttributes>, - but they contain exactly the same set of elements. + <fileAttributes> and + <directoryAttributes>, but they contain exactly + the same set of elements. Available attributes - + @@ -1778,7 +1782,7 @@ - See for more + See for more details. @@ -1803,7 +1807,7 @@ Supported parameters for <tag><copyFile></tag> - + @@ -1826,7 +1830,7 @@ attributes The attributes to set on the copied file. See . + linkend="file-attributes"/>. @@ -1859,14 +1863,14 @@ <copyArtifact> - + artifact The artifact to copy. See on how to + linkend="artifact-naming-and-identification"/> on how to identify the artifact to copy. @@ -1884,7 +1888,7 @@ attributesThe attributes to set on the copied file. See . + linkend="file-attributes"/>. @@ -1905,16 +1909,177 @@ +
+ Filter Files + + Purpose: runs regular expressions and control line ending of the + matched files. + +
+ Supported parameters for + <tag><filterFiles></tag> + + + + + + + includes and + excludes + + Selects which files to include into the package. See + . + + + + lineEnding + + Controls the line ending of the filtered file. Legal + values are: keep, unix, + windows. + + + + regexes + + A optional list of regular expression patterns and + replacement texts. If empty, a list is generated from the + available properties. See . + + + +
+ + + Example usage of <tag><filterFiles></tag> + + <filterFiles> + <includes> + <include>/opt/hudson/etc/*</include> + </includes> + <excludes> + <exclude>/opt/hudson/etc/unfiltered.properties</exclude> + </excludes> + <regexes> + <regex> + <!-- A simple regex --> + <pattern>MY_PLACEHOLDER</pattern> + <replacement>MY_VALUE</replacement> + </regex> + <regex> + <!-- A regex using replacements --> + <pattern>^([-a-z]*)=(/.*)</pattern> + <replacement>$1=/foo$2</replacement> + </regex> + </regexes> +</filterFiles> + + + This operation will add the regular expressions to all the files + matched. The regular expressions will be executed in the order + specified. + + + Note that the second regular expression will be executed on + the output of the first expression so that the changes accumulate + through all the expressions. + + +
+ Property + Interpolation + + If no regular expressions are given, a list of regular + expressions will be generated based on the available properties from + Maven. There are three kinds of properties: + + + + System properties + + + The properties available from System.getProperties() + and System.getenv(). + The environment properties will be available under the + env. prefix. + + + + + User properties + + + Properties specified with -D on the command line. + + + + + Project properties + + + Properties specified with the + <properties> tag. + + + + + In addition to these properties, three extra properties are + added for convenience: + + + + project.groupId + + + + project.artifactId + + + + project.version + + + + The generated expression will be similar to + ${proper.properties} so that it will look like + normal interpolation. However, there is a difference in the keys + available as the plugin doesn't use reflection to inspect the Maven + Project Model.This means that expressions like + ${project.target.direcetory} will not + work. + + To get that kind of expressions to work you have to create a + project property and use the new property + (targetDirectory) as a key: + + + + + <literallayout><project> + .. + <properties> + <targetDirectory>${project.output.directory}</targetDirectory> + </properties> +</project></literallayout> + </example> + </section> + </section> + <section xml:id="make-directory"> <title>Make Directory - Purpose: to create one or more directories + Purpose: to create one or more directories. - Supported parameters <tag><makeDirectory></tag> + Supported parameters for + <tag><makeDirectory></tag> - + @@ -1929,7 +2094,7 @@ attributes The attributes to set on the copied file. See . + linkend="file-attributes"/>. @@ -1962,7 +2127,7 @@ Supported parameters <tag><setAttributes></tag> - + @@ -1977,7 +2142,7 @@ The attributes to set on the matched files. See . + linkend="file-attributes"/>. @@ -1985,7 +2150,7 @@ The attributes to set on the matched directories. See . + linkend="file-attributes"/>. @@ -1993,7 +2158,7 @@ excludes Selects which files to include into the package. See - . + . @@ -2022,7 +2187,7 @@ Supported parameters <tag><symlink></tag> - + @@ -2065,7 +2230,7 @@ and extract file operations - + @@ -2079,7 +2244,7 @@ excludes Selects which files to include into the package. See - . + . @@ -2087,7 +2252,7 @@ replacement Controls renaming of the files. See . + linkend="file-renaming"/>. @@ -2095,7 +2260,7 @@ The attributes to set on the matched files. See . + linkend="file-attributes"/>. @@ -2103,7 +2268,7 @@ The attributes to set on the matched directories. See . + linkend="file-attributes"/>. @@ -2119,7 +2284,7 @@ <copyDirectory> - + @@ -2152,14 +2317,14 @@ <extractArtifacrt> - + artifact The artifact to copy. See on how to + linkend="artifact-naming-and-identification"/> on how to identify the artifact to copy. @@ -2197,14 +2362,14 @@ <extractFile> - + archive The path to an archive to extract. See on how to + linkend="artifact-naming-and-identification"/> on how to identify the artifact to copy. @@ -2226,24 +2391,24 @@ Creating Native Package Repositories - +
Creating Debian/APT Repositories - +
Creating RPM/Yum Repositories - +
Creating pkg-get/pkgutil Repositories - +
@@ -2309,7 +2474,7 @@ Output of <code>rpm -q -l -p</code> + href="command-reference/rpm-qlp.txt" parse="text"/> @@ -2324,7 +2489,7 @@ Output of <code>rpm -q -l -p</code> + href="command-reference/rpm-qlp.txt" parse="text"/> @@ -2335,7 +2500,7 @@ Output of <code>rpm -q -l -p -v</code> + href="command-reference/rpm-qvlp.txt" parse="text"/> @@ -2349,7 +2514,7 @@ Listing all available software groups + href="command-reference/cat-GROUPS.txt" parse="text"/> @@ -2364,7 +2529,7 @@ Listing all files in a ZIP file + href="command-reference/unzip-l.txt" parse="text"/> @@ -2510,10 +2675,10 @@ <classifier> to be closer to the existing Maven nomenclature. - All examples use hyphenated elements instead of camel casing to be - more consistent with how Maven POMs normally are written. This will - not break any builds as Maven interpret both versions the same way. For - example <fileAttributes> is now used instead of + All examples use hyphenated elements instead of camel casing to + be more consistent with how Maven POMs normally are written. This will + not break any builds as Maven interpret both versions the same way. + For example <fileAttributes> is now used instead of <file-attribues>.