I think this is a great idea, especially if it can process a reactor
full of POMs, and handle multiple xpaths where a target value might show
up (the set:
{project/parent/version,
project/version,
project/properties/mavenVersion}
would be one good first use case, for instance). I've got a plugin that
I've written to do something like this, but it's focused solely on
versions for now...and it also uses xpaths. I'd love to see this
expanded to other xpaths, though, no reason we shouldn't do that...and I
think this plugin is a good place to do it.
-j
---
John Casey
Developer and PMC Member, Apache Maven (http://maven.apache.org)
Member, Apache Software Foundation
Blog: http://www.ejlife.net/blogs/buildchimp
Jesse McConnell wrote:
hi all,
A long while back I added a plugin into the maven sandbox for
modifying one or more pom files in the process of the build, not the
active pom's in a reactor but at least in instances where you had a
scm checkout process in your build and needed to modify the checked
out project before building it in turn...
It is pretty simple plugin with lots of mojos for dealing with various
instances of pom modification like adding dependencies, altering
dependency versions, tweaking scm info, etc....however most if not all
can be replaced by complex usage of the simple but powerful
alter-by-xpath mojo.
I have gone back and added in some unit tests for examples sake and
cobbled together a website for it....and wanted to see if there was
any thought about perhaps bringing out of the sandbox or simply moving
it over to mojo since its perhaps not a complex enough process to
warrant placement in the official maven plugin set...
https://svn.apache.org/repos/asf/maven/sandbox/trunk/plugins/maven-pom-plugin
With modern editors I see no reason someone would use this plugin to
modify sets of project files from the command line, but it does offer
the ability to do something like this:
mvn -DprojectFile=pom.xml
-Dxpath="/project/dependencies/dependency[artifactId[.='commons-collections']]/version"
-DnewValue=3.3
org.apache.maven.plugins:maven-pom-plugin:1.0-SNAPSHOT:alter-by-xpath
which could be useful in scripting situations...Or it could be put
into a pom.xml setup that performs the scm checkout and then does a
consistent set of permutations to the project
anyway, thoughts?
jesse
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]