You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jm...@apache.org on 2007/06/22 21:26:52 UTC
svn commit: r549937 - in
/maven/sandbox/trunk/plugins/maven-patch-plugin/src/site: ./ apt/
apt/examples/ apt/examples/multiple.apt apt/examples/single.apt apt/faq.apt
apt/index.apt apt/usage.apt site.xml
Author: jmcconnell
Date: Fri Jun 22 12:26:51 2007
New Revision: 549937
URL: http://svn.apache.org/viewvc?view=rev&rev=549937
Log:
some initial documentation for the maven-patch-plugin
Added:
maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/
maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/
maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/examples/
maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/examples/multiple.apt
maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/examples/single.apt
maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/faq.apt
maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/index.apt
maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/usage.apt
maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/site.xml
Added: maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/examples/multiple.apt
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/examples/multiple.apt?view=auto&rev=549937
==============================================================================
--- maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/examples/multiple.apt (added)
+++ maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/examples/multiple.apt Fri Jun 22 12:26:51 2007
@@ -0,0 +1,84 @@
+ ------
+ Delete Additional Files Not Exposed to Maven
+ ------
+ John Casey
+ Jesse McConnell
+ ------
+ 22 June 2007
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
+Patch Multiple Files from Multiple Directories
+
+ The <<<maven-patch-plugin>>> can be configured apply sets of patches from multiple directories.
+ In the example below, the plugin is setup to apply all the patches in a bugfix directory with
+ optimization (will not reapply the same patch) and also from an enhancements directory. This
+ scenario might crop up if you don't have commit access to a projects source yet need to apply
+ bugfix and enhancement patches. The two different patch source directories are shown purely as
+ an example of what can be configured.
+
++--------
+<build>
+ [...]
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-patch-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <configuration>
+ <patchTargetDir>${moduleDirectory}</patchTargetDir>
+ <skipApplication>false</skipApplication>
+ </configuration>
+ <executions>
+ <execution>
+ <id>bugfix-patches</id>
+ <configuration>
+ <patchDirectory>src/main/patches/bugfix</patchDirecto
+ry>
+ <patchTrackingFile>${project.build.directory}/optimization-
+files/bugfix/patches-applied.txt</patchTrackingFile>
+ <naturalOrderProcessing>true</naturalOrderProcessing>
+ </configuration>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>apply-directory</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>enhancement-patches</id>
+ <configuration>
+ <patchDirectory>src/main/patches/enhancement</patchDirector
+y>
+ <patchTrackingFile>${project.build.directory}/optimization-
+files/enhancement/patches-applied.txt</patchTrackingFile>
+ <naturalOrderProcessing>true</naturalOrderProcessing>
+ </configuration>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>apply-directory</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ [...]
+</build>
++---------
Added: maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/examples/single.apt
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/examples/single.apt?view=auto&rev=549937
==============================================================================
--- maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/examples/single.apt (added)
+++ maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/examples/single.apt Fri Jun 22 12:26:51 2007
@@ -0,0 +1,57 @@
+ ------
+ Delete Additional Files Not Exposed to Maven
+ ------
+ John Casey
+ Jesse McConnell
+ ------
+ 22 June 2007
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
+Patch a Single File
+
+ The <<<maven-patch-plugin>>> can be configured to apply a single patch to a file as specified:
+
++--------
+<build>
+ [...]
+
+ <plugin>
+ <artifactId>maven-patch-plugin</artifactId>
+ <configuration>
+ <patches>
+ <patch>mylittle.patch</patch>
+ </patches>
+ </configuration>
+ <executions>
+ <execution>
+ <id>patch</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>apply</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ [...]
+</build>
++---------
Added: maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/faq.apt
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/faq.apt?view=auto&rev=549937
==============================================================================
--- maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/faq.apt (added)
+++ maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/faq.apt Fri Jun 22 12:26:51 2007
@@ -0,0 +1,46 @@
+ ------
+ Frequently Asked Questions
+ ------
+ John Casey
+ Jesse McConnell
+ ------
+ 22 June 2007
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
+Frequently Asked Questions
+
+ [[1]] {{{#1.} What would a patch plugin even be used for?}}
+
+* Answers
+
+ {1.} In certain environments direct source modification is not
+ allowed so to make alterations to the source you need some patch
+ application process. This plugin seeks to address those situations.
+
+ [[2]] {{{#2.} Why won't this work on windows?}}
+
+* Answers
+
+ {1.} This patch wraps the gnu patch tool, which must be in your path
+ in order to function properly.
+
Added: maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/index.apt?view=auto&rev=549937
==============================================================================
--- maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/index.apt (added)
+++ maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/index.apt Fri Jun 22 12:26:51 2007
@@ -0,0 +1,49 @@
+ ------
+ Maven Patch Plugin
+ ------
+ John Casey
+ Jesse McConnell
+ ------
+ 22 June 2007
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
+Overview
+
+ The patch plugin is used to apply patches to source files.
+
+* Goals Overview
+
+ The patch plugin has two goals, one for applying a single declared patch and another for applying a directory of patches.
+
+* Usage
+
+ Instructions on the basic usage of the patch plugin can be found
+ {{{usage.html}here}}.
+
+* Examples
+
+ To provide you with better understanding on some usages of the patch plugin,
+ you can take a look into the following examples:
+
+ * {{{examples/single.html}How to patch from a single file.}}
+ * {{{examples/multiple.html}How to patch from a directory of patches.}}
Added: maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/usage.apt
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/usage.apt?view=auto&rev=549937
==============================================================================
--- maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/usage.apt (added)
+++ maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/apt/usage.apt Fri Jun 22 12:26:51 2007
@@ -0,0 +1,70 @@
+ ------
+ Usage
+ ------
+ John Casey
+ Jesse McConnell
+ ------
+ 22 June 2007
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
+Introduction
+
+ The maven-patch-plugin attempts to use the gnu patch tool to apply patch files
+ to source code. It can be configured to apply patch files from any number of
+ directories with a number of different policies including strict patching where
+ you must declare all patchs in the plugin configuration to a natural order processing
+ which will apply all patching in a directory following a natural string sorted order.
+
+ This plugin is most commonly used during the process-sources phase of the maven lifecycle.
+
++-----
+ mvn process-sources
++-----
+
++-----
+<project>
+ [...]
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-patch-plugin</artifactId>
+ <configuration>
+ <patches>
+ <patch>mylittle.patch</patch>
+ </patches>
+ </configuration>
+ <executions>
+ <execution>
+ <id>patch</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>apply</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ [...]
+</project>
++-----
\ No newline at end of file
Added: maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/site.xml?view=auto&rev=549937
==============================================================================
--- maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/site.xml (added)
+++ maven/sandbox/trunk/plugins/maven-patch-plugin/src/site/site.xml Fri Jun 22 12:26:51 2007
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+ <body>
+ <menu name="Overview">
+ <item name="Introduction" href="index.html"/>
+ <item name="Goals" href="plugin-info.html"/>
+ <item name="Usage" href="usage.html"/>
+ <item name="FAQ" href="faq.html"/>
+ </menu>
+ <menu name="Examples">
+ <item name="Single Patch" href="examples/single.html"/>
+ <item name="Multiple Patch" href="examples/multiple.html"/>
+ </menu>
+ </body>
+</project>