Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Maven User
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<h1>pom-maven-plugin</h1> <p>I created a new MOJO called pom-maven-plugin which aims to help with POM tasks in large projects.</p> <p>Currently it is located in Sandbox: <a href="https://svn.codehaus.org/mojo/trunk/sandbox/pom-maven-plugin">https://svn.codehaus.org/mojo/trunk/sandbox/pom-maven-plugin</a></p> <p>You need to check it out and do "mvn install".</p> <p>After that you are ready to use the plugin.</p> <h2>Refactoring POMs</h2> <p>There is a goal for refactoring POMs in a project called "pom:refactor". You should call this goal on your toplevel project.</p> <p>Examples:</p> <ul> <li>mvn pom:refactor -DartifactId=myArtifact -DnewVersion=2.1<br /> This will set the version of all occurrences of "myArtifact" in your POMs to "2.1" including all dependencies that point to the current version.</li> <li>mvn pom:refactor -DartifactId=myArtifact -Dversion=* -DnewVersion=2.1<br /> This will set the version of all occurrences of "myArtifact" in your POMs to "2.1" including all dependencies that point to the current version.</li> <li>mvn pom:refactor -DartifactId=myArtifact -Dversion=2.1-SNAPSHOT -DnewVersion=2.1<br /> This will set the version of all occurrences of "myArtifact" in your POMs where current version is "2.1-SNAPSHOT" to "2.1"</li> <li>mvn pom:refactor -DartifactId=* -DnewGroupId=foo.bar<br /> This will change the groupId of all your modules to "foo.bar" (and fix all according dependencies).</li> <li>mvn pom:refactor -DartifactId=myArtifact -DgroupId=foo.bar -DnewScope=test<br /> This will set the scope of all dependencies on "foo.bar:myArtifact" to "test"</li> </ul> <p>In general you define a matcher for projects, dependencies, etc. with</p> <ul> <li>artifactId (required parameter, set to * to match any artifactId)</li> <li>groupId (${project.groupId} if omitted)</li> <li>version (current version of matching project in reactor if omitted, use * to match any version)</li> <li>scope (scope to match in dependencies, any if omitted)</li> <li>classifier (classifier to match in dependencies, any if omitted)</li> </ul> <p>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.</p> <p>To express what to change for the matching sections, you must specify at least one of</p> <ul> <li>newArtifactId</li> <li>newGroupId</li> <li>newVersion</li> <li>newScope</li> <li>newClassifier</li> </ul> <p>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}".</p> <p>Further important options:</p> <ul> <li>overwrite (true: overwrite pom.xml files, false: write to target/pom-refactored.xml - default)</li> <li>requireToplevel (default is true, if your toplevel-POM on local disc has a parent you need to set to false)</li> <li>xmlEncoding (defaults to file.encoding)</li> </ul>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced