This is a near-trivial Maven 3 extension, that provides following services:
Currently there are 4 sources just to showcase things:
Look into ITs for examples.
Nisse offers a Plugin and a Core Extension. With using Plugin only, features you can use is LIMITED to properties injection into Project properties (a la properties-maven-plugin from Mojohaus). To use Nisse Plugin, add it to your POM like this:
<plugin>
<groupId>eu.maveniverse.maven.nisse</groupId>
<artifactId>plugin3</artifactId>
<version>${version.nisse}</version>
<executions>
<execution>
<id>inject-properties</id>
<goals>
<goal>inject-properties</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
</plugin>
The Nisse Extension extension3
is more powerful, to use it add this to your .mvn/extensions.xml
file:
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<extension>
<groupId>eu.maveniverse.maven.nisse</groupId>
<artifactId>extension3</artifactId>
<version>${version.nisse}</version>
</extension>
</extensions>
And then you can inspect what is being added to user properties by running Toolbox dump
:
$ mvn eu.maveniverse.maven.plugins:toolbox:dump -Dverbose -N
Look for "USER PROPERTIES" section. Nisse injected some properties for you as they were user properties.
Moreover, you are free to use them as version (ie. <version>${nisse.jgit.commit}</version>
) and look
what happens. Oh, and just install/deploy as usual, no need for any mumbo-jumbo.
With extension present, the "CI friendly feature" of Maven is improved as:
Current stance is that Maven 4 will support similar features out of the box. Nisse does not work with Maven 4 currently, but things may change.