Skip to content

This Maven plugin, used in conjonction with Continuous Integration friendly Maven features, allows you to bypass the need to use the flatten plugin

Notifications You must be signed in to change notification settings

fmarot/cifriendly-maven-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Latest Maven Central deployment

Goal

Extension

TODO:

on specific content in mavenSession.getRequest().getGoals() ⇒ we should autoskip the plugin to avoid messing with incompatible goals

flatten

Replace the '${revision}' variables in all pom.xml of the MultiModule Maven Project with the real hardcoded version found in the upper pom’s properties/revision node.

For example all child pom’s "${revision}" version in their <parent> declaration will be replaced with the hardcoded "1.2.3-SNAPSHOT" if the upper pom contains:

<properties>
	<revision>1.2.3-SNAPSHOT</revision>
	...
</properties>

unflatten

First, in the upper pom, the hardcoded version is transfered into the properties/revision node, overwriting any previous value. So after a Maven release, the properties/revision node will see the correct version again.

Then it replaces the hardcoded version in all the poms (including the upper one) with a "${revision}" variable. In the upper pom.

Warning: caveats of CI friendly

using CI friendly Maven forces the local dev to always execute from the upper pomso that ${revision} is defined. Otherwise child pom will not know their parent.

So we have to use the --projects feature of Maven from the root if we want to build only a specific child. We can not build directly from its sub-directory.

TODO

  • for flatten Mojo, use the same principle as for the unflatten Mojo so that we can have better logs (no saying "Rewriting pom" when in fact the pom is already flattened)

Usage

mvn com.teamtter.maven:cifriendly-maven-plugin:1.0.8:unflatten

Technical details

the library "decentxml" is used to keep pom formatting

Tip

To change the version of a CIFriendly multi-module (or single) project, just use:

mvn versions:set-property -DnewVersion=3.0.0-SNAPSHOT -Dproperty=revision

About

This Maven plugin, used in conjonction with Continuous Integration friendly Maven features, allows you to bypass the need to use the flatten plugin

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages