Coder Social home page Coder Social logo

pom-maven-plugin's Introduction

Pom-maven-plugin

Pom-maven-plugin which aims to help with POM tasks in large projects.

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:

mvn pom:refactor -DartifactId=myArtifact -DnewVersion=2.1
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.
mvn pom:refactor -DartifactId=myArtifact -Dversion=* -DnewVersion=2.1
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.
mvn pom:refactor -DartifactId=myArtifact -Dversion=2.1-SNAPSHOT -DnewVersion=2.1
This will set the version of all occurrences of "myArtifact" in your POMs where current version is "2.1-SNAPSHOT" to "2.1"
mvn pom:refactor -DartifactId=* -DnewGroupId=foo.bar
This will change the groupId of all your modules to "foo.bar" (and fix all according dependencies).
mvn pom:refactor -DartifactId=myArtifact -DgroupId=foo.bar -DnewScope=test
This will set the scope of all dependencies on "foo.bar:myArtifact" to "test"

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

artifactId (required parameter, set to * to match any artifactId)
groupId (${project.groupId} if omitted)
version (current version of matching project in reactor if omitted, use * to match any version)
scope (scope to match in dependencies, any if omitted)
classifier (classifier to match in dependencies, any if omitted)

For all these 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

newArtifactId
newGroupId
newVersion
newScope
newClassifier

Please also note that the plugin takes care about distribution management 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:

overwrite (true: overwrite pom.xml files, false: write to target/pom-refactored.xml - default)
requireToplevel (default is true, if your toplevel-POM on local disc has a parent you need to set to false)
xmlEncoding (defaults to file.encoding)

pom-maven-plugin's People

Contributors

atkawa7 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.