cifriendly-maven-plugin Maven Mojo

This plugin helps with configuring Maven projects (especially multi-modules) for them to be Continuous Integration friendly.

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

com.teamtter.maven
ArtifactId

ArtifactId

cifriendly-maven-plugin
Last Version

Last Version

1.0.8
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

cifriendly-maven-plugin Maven Mojo
This plugin helps with configuring Maven projects (especially multi-modules) for them to be Continuous Integration friendly.
Project URL

Project URL

http://maven.apache.org
Source Code Management

Source Code Management

https://github.com/fmarot/cifriendly-maven-plugin

Download cifriendly-maven-plugin

How to add to project

<plugin>
    <groupId>com.teamtter.maven</groupId>
    <artifactId>cifriendly-maven-plugin</artifactId>
    <version>1.0.8</version>
</plugin>

Dependencies

compile (6)

Group / Artifact Type Version
org.apache.maven : maven-core jar 3.5.0
org.apache.maven : maven-artifact jar 3.5.0
org.apache.maven : maven-model jar 3.5.0
org.apache.maven : maven-plugin-api jar 3.5.0
de.pdark : decentxml jar 1.4
org.projectlombok : lombok jar 1.16.16

provided (2)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.5
org.slf4j : slf4j-api jar 1.7.5

test (2)

Group / Artifact Type Version
org.slf4j : slf4j-simple jar 1.7.5
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

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

Versions

Version
1.0.8
1.0.7
1.0.6