pom-maven-plugin

I created a new MOJO called pom-maven-plugin which aims to help with POM tasks in large projects.

Currently it is located in Sandbox: https://svn.codehaus.org/mojo/trunk/sandbox/pom-maven-plugin

You need to check it out and do "mvn install".

After  that you are ready to use the plugin.

Refactoring POMs

There is a goal for refactoring POMs in a project called "pom:refactor". You should call this goal on your toplevel project.

Examples:

In general you define a matcher for projects, dependencies, etc. with

For all this parameters you can use glob-patterns (using * as wildcard and ?). Please note that your shell might expand such patterns with the matching files in your current directory so you might need to escape this properly.

To express what to change for the matching sections, you must specify at least one of

Please also note that the plugin takes care about disributionManagement and variables. In such case it tries to perform the modification where the actual value is defined. However you might be able to create wired constructs where the strategy will fail. But it should work for regular usecases. You can also set "resolveVariables" to false if you want to disable and allow to replace "${foo}" with "${bar}".

Further important options: