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 2008/10/06 19:10:26 UTC
svn commit: r702203 - in /maven/sandbox/trunk/plugins/maven-pom-plugin/src:
site/ site/apt/ site/apt/examples/ site/fml/
test/resources/unit/alter-by-xpath-test/
Author: jmcconnell
Date: Mon Oct 6 10:10:25 2008
New Revision: 702203
URL: http://svn.apache.org/viewvc?rev=702203&view=rev
Log:
finally resolved eclipse svn issues and adding in site and missing test file
Added:
maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/
maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/
maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/examples/
maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/examples/alter-by-xpath.apt
maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/index.apt
maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/usage.apt
maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/fml/
maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/fml/faq.fml
maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/site.xml
maven/sandbox/trunk/plugins/maven-pom-plugin/src/test/resources/unit/alter-by-xpath-test/test-pom.xml
Added: maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/examples/alter-by-xpath.apt
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/examples/alter-by-xpath.apt?rev=702203&view=auto
==============================================================================
--- maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/examples/alter-by-xpath.apt (added)
+++ maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/examples/alter-by-xpath.apt Mon Oct 6 10:10:25 2008
@@ -0,0 +1,52 @@
+ ------
+ Altering a pom via xpath expression
+ ------
+ Jesse McConnell
+ <jm...@apache.org>
+ ------
+ 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/doxia/references/apt-format.html
+
+Altering a pom via xpath expression
+
+ The Maven Pom Plugin allows you to alter many elements of a pom based off of xpath expressions. One common usage is to target a specific element in a pom file and alter its value.
+
+ The following example shows how:
+
++--------
+<build>
+ [...]
+ <plugin>
+ <artifactId>maven-pom-plugin</artifactId>
+ <configuration>
+ <xpath>/project/dependencies/dependency[artifactId[.='commons-collections']]/version</xpath>
+ <newValue>1.1-SNAPSHOT</newValue>
+ <projectFile>${basedir}/target/test-files/unit/alter-by-xpath-test/test-pom.xml</projectFile>
+ <failFast>true</failFast>
+ </configuration>
+ </plugin>
+ [...]
+</build>
++---------
+
+ You don't need to be an xpath master to do most adjustments, the above statement addresses one of the harder statements to craft.
\ No newline at end of file
Added: maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/index.apt?rev=702203&view=auto
==============================================================================
--- maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/index.apt (added)
+++ maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/index.apt Mon Oct 6 10:10:25 2008
@@ -0,0 +1,74 @@
+ ------
+ Introduction
+ ------
+ Jesse McConnell
+ ------
+ 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/doxia/references/apt-format.html
+
+Maven Pom Plugin
+
+ The Pom Plugin is used when you want to modify one or more more pom.xml files in a programatic fashion.
+
+* Goals Overview
+
+ The Pom Plugin only has many goals.
+
+ * {{{add-dependencies.html}pom:add-dependencies}}
+ * {{{alter-parent.html}pom:alter-parent}}
+ * {{{alter-properties.html}pom:alter-properties}}
+ * {{{remove-by-xpath.html}pom:remove-by-xpath}}
+ * {{{add-by-xpath.html}pom:add-by-xpath}}
+ * {{{alter-modules.html}pom:alter-modules}}
+ * {{{alter-scm.html}pom:alter-scm}}
+ * {{{alter-by-xpath.html}pom:alter-by-xpath}}
+ * {{{alter-dependencies.html}pom:alter-dependencies}}
+ * {{{alter-mojo.html}pom:alter-mojo}}
+ * {{{alter-version.html}pom:alter-version}}
+
+* Usage
+
+ General instructions on how to use the Pom Plugin can be found on the {{{usage.html}usage page}}. Some more
+ specific use cases are described in the examples given below.
+
+ In case you still have questions regarding the plugin's usage, please have a look at the {{{faq.html}FAQ}} and feel
+ free to contact the {{{mail-lists.html}user mailing list}}. The posts to the mailing list are archived and could
+ already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching
+ the {{{mail-lists.html}mail archive}}.
+
+ If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our
+ {{{issue-tracking.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your
+ concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason,
+ entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated.
+ Of course, patches are welcome, too. Contributors can check out the project from our
+ {{{source-repository.html}source repository}} and will find supplementary information in the
+ {{{http://maven.apache.org/guides/development/guide-helping.html}guide to helping with Maven}}.
+
+* Examples
+
+ To provide you with better understanding on some usages of the Pom Plugin,
+ you can take a look into the following examples:
+
+ * {{{examples/alter-by-xpath.html}Altering a pom via xpath expression}}
+
+ []
Added: maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/usage.apt
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/usage.apt?rev=702203&view=auto
==============================================================================
--- maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/usage.apt (added)
+++ maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/apt/usage.apt Mon Oct 6 10:10:25 2008
@@ -0,0 +1,34 @@
+ ------
+ Usage
+ ------
+ Jesse McConnell
+ ------
+ 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/doxia/references/apt-format.html
+
+Usage
+
+ The Maven Pom Plugin is useful for a variety of situations, one important one being cases where you need to checkout a thirdparty application during your build process with the maven-scm-plugin and slightly alter the building mechanism at build time. The pom plugin can be used via the command line to alter a single pom or multiple poms in some cases, but that is hardly useful since you can do this with a standard editor easier then crafting xpath statement after xpath statement.
+
+ This becomes useful in case where you checkout a mess of source, perhaps apply some patches with the maven-patch-plugin and then want to build the source for a different version. This can be accomplished via a combination of multiple execution statements and either the reactor plugin or the maven exec plugin.
+
+ The plugin is basically very simple with alter-by-xpath being the most powerful which can basically perform the actions of the other mojos. Other mojo's like the alter-dependencies mojo are convience mojos which work to alter dependencies and dependencyManagement elements accordingly. Some mojo's work for single pom.xml targets while others can process multiple files at once.
\ No newline at end of file
Added: maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/fml/faq.fml
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/fml/faq.fml?rev=702203&view=auto
==============================================================================
--- maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/fml/faq.fml (added)
+++ maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/fml/faq.fml Mon Oct 6 10:10:25 2008
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<faqs id="FAQ" title="Frequently Asked Questions">
+ <part id="General">
+ <faq id="I already ran mvn clean but the directory (put dir name here) is still there. What should I do?">
+ <question>I already ran <i>mvn clean</i> but the directory (<i>put dir name here</i>) is still there. What should I do?</question>
+ <answer>
+ <p>
+ Some files-generating plugins can generate their files outside of the
+ default directories being deleted by the clean plugin. You should add
+ the location of such files in the clean plugin configuration or change
+ the configuration of those plugins to put their files inside the
+ <i>project.build.directory</i> which is by default, the <i>target</i>
+ directory.
+ </p>
+ </answer>
+ </faq>
+ <faq id="On Windows, I got Unable to delete directory. What s wrong?">
+ <question>On Windows, I got <i>"Unable to delete directory"</i>. What's wrong?</question>
+ <answer>
+ <p>
+ For instance, <i>clean</i> could fail if you already have opened a command
+ line with target as the current dir. Windows locks some ressources and you need
+ to close the handles on these ressources.
+ To skip these errors, you could call <i>clean</i> with the command line parameter <i>-Dmaven.clean.failOnError=false</i>.
+ For more information, refer to <a href="./examples/ignoring-errors.html">Ignoring Errors</a> page.
+ </p>
+ <p>
+ <a href="http://www.microsoft.com/technet/sysinternals/default.mspx">Sysinternals</a> produced
+ a number of utilities, like <a href="http://www.microsoft.com/technet/sysinternals/Utilities/ProcessExplorer.mspx">Process Explorer</a>
+ or <a href="http://www.microsoft.com/technet/sysinternals/utilities/handle.mspx">Handle</a>
+ that help you to deal with Windows handles.
+ </p>
+ </answer>
+ </faq>
+ </part>
+</faqs>
\ No newline at end of file
Added: maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/site.xml?rev=702203&view=auto
==============================================================================
--- maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/site.xml (added)
+++ maven/sandbox/trunk/plugins/maven-pom-plugin/src/site/site.xml Mon Oct 6 10:10:25 2008
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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="Alter by XPath" href="examples/alter-by-xpath.html"/>
+ </menu>
+ </body>
+</project>
Added: maven/sandbox/trunk/plugins/maven-pom-plugin/src/test/resources/unit/alter-by-xpath-test/test-pom.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-pom-plugin/src/test/resources/unit/alter-by-xpath-test/test-pom.xml?rev=702203&view=auto
==============================================================================
--- maven/sandbox/trunk/plugins/maven-pom-plugin/src/test/resources/unit/alter-by-xpath-test/test-pom.xml (added)
+++ maven/sandbox/trunk/plugins/maven-pom-plugin/src/test/resources/unit/alter-by-xpath-test/test-pom.xml Mon Oct 6 10:10:25 2008
@@ -0,0 +1,25 @@
+<project>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ <version>1.6.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xom</groupId>
+ <artifactId>xom</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2</version>
+ </dependency>
+ </dependencies>
+</project>