https://github.com/raydac/uber-pom
Maven plugin to create uber-pom through merging of all pom files in hierarchy
https://github.com/raydac/uber-pom
java maven-multimodule maven-plugin
Last synced: about 1 year ago
JSON representation
Maven plugin to create uber-pom through merging of all pom files in hierarchy
- Host: GitHub
- URL: https://github.com/raydac/uber-pom
- Owner: raydac
- License: apache-2.0
- Created: 2015-05-30T09:33:05.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2021-06-05T13:46:35.000Z (about 5 years ago)
- Last Synced: 2025-03-27T12:46:37.899Z (over 1 year ago)
- Topics: java, maven-multimodule, maven-plugin
- Language: Java
- Size: 76.2 KB
- Stars: 7
- Watchers: 2
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](http://www.apache.org/licenses/LICENSE-2.0)
[](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
[](http://search.maven.org/#artifactdetails|com.igormaznitsa|uber-pom|1.0.3|jar)
[](https://maven.apache.org/)
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AHWJHJFBAWGL2)
[](https://yoomoney.ru/to/41001158080699)
# Introduction
I have maven plugins under development and some of them are published in maven central. Usually each plugin is developed in bounds of some maven project tree wich more or less complex structure but such structure not needed for artifact publishing. To get plain version of pom.xml with only needed fields, I have developed the plug-in and it works well for my purposes. I have published it in the maven central and hope it will be useful for someone else.
# Changelog
__1.0.3 (31-jul-2019)__
- refactoring
__1.0.2 (04-apr-2019)__
- added `removeDependencies` with wildcard support
__1.0.1 (17-apr-2016)__
- issue #3, added flag `removeSiblingDuplications` to find sibling duplications in the result uber pom XML and removing them. By default it is turned off.
- issue #2, added support for system property 'upom.delete.on.exit' to override value of 'deleteOnExit' parameter
__1.0__
- Initial version
# How it works?
The plugin just merging all pom.xml in project module tree hierarchy (or only required depth of the hierarchy tree) and saves the created uber-pom into required place. The new generated pom file path provided into the current active maven project model. It during INITIALIZE phase and the result packed artifact will have the uber-pom packed in the result artifact.
# May be there is official solution?
I have found [flatten-maven-plugin](http://mojo.codehaus.org/flatten-maven-plugin/), it also allows to make similar business but it works not very well in pair with maven-shade-plugin and it is critically for me.
# How to use?
## Add the plugin in pom.xml
Just add the plugin into pom.xml of the project which needs uber-pom
```
...
com.igormaznitsa
uber-pom
1.0.3
parent
modules
profiles/profile/modules
true
test
*
upom
...
```
__NB! By default the plugin just merging pom models in hierarchy, so you should add `` section to remove the 'parent' and 'modules' from the result uber-pom. I don't make that automaticaly to keep universality.__
## I want to remove some sections in the result
Just add list of paths to the sections into `` and the sections will be removed from the result.
```
developers
build/plugins
developers/developer/email
```
## I want keep some sections unchanged!
Add paths to such sections into `` property
```
developers
description
```
those secttions in the result will be the same as in the original project pom.xml.
## How to change value of some pom parameters?
Sometime it is good to change some record in the pom.xml, the plugin allows to do that
```
description
It is new description of the pom.xml
developers/developer/email
newemail@alldevelopers.com
```
## How to change default place for generated uber-pom?
Generated uber-pom by default will be placed in the same folder where the project pom is. You can change that through `` property.
```
/anotherFolderToSaveUberPom
```
## I want to change the result uber-pom name
By default the uber-pom named as `uber-pom.xml` but sometime should be changed, it is possible through `` property.
```
customUberPom.xml
```
## I can't find uber-pom after session
By default the generated uber-pom will be removed after session. If you want to keep the file then disable delete action with flag ``
```
false
```
## How to merge only restricted number of hierarchy levels?
By default the plugin merges all hierarchy levels till the root, but you can restrict the number with the `` property
```
2
```
In the example, only two upper tree levels will be involved into build of merging result.