maveniverse / nisse

Maveniverse Nisse
Eclipse Public License 2.0
1 stars 1 forks source link
ci-friendly maven maven-extension maven-plugin

Maveniverse Nisse

This is a near-trivial Maven 3 extension, that provides following services:

Implemented Sources

Currently there are 4 sources just to showcase things:

Look into ITs for examples.

Usage with Maven 3.9.x and 3.8.x

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:

Usage with Maven 4.0.x

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.