maveniverse / nisse

Maveniverse Nisse
Eclipse Public License 2.0
0 stars 0 forks source link

Add support for dynamic versioning (and possibly Maven CI Friendly) #9

Open jimisola opened 1 week ago

jimisola commented 1 week ago

Other langauges and build systems have something called dynamic versioning which means that the project version can be left out in the project configuration file (here: pom.xml) and instead the version is set dynamically based on tag in git repo. It the current comment does not have tag with valid semantic version then the nearest is found and the number of commits to that commit from HEAD will be build number.

Due to a limitation in Maven the current "solution" of MojoHaus Versions Maven plugin goal does not work. @cstamas described it here and as a the idea is to migrate the MojoHaus Versions Plugin goal to nisse as core extension.

The current goal has few optional parameters:

I'm currently not sure how configuration can be made for a core extension. Any input here would be appreciated.

Also, I'm not sure if there is any benefit of using ${revision} as Maven CI Friendly.

jimisola commented 1 week ago

My plan is to hopefully start with this next week when we gave a new sprint a work and then provide a PR.

cstamas commented 1 week ago

Just some context: idea with Nisse is "Maven 3 CI friendly versions done right", is just a showcase with some usable extensions.

Problems with vanilla Maven CI Friendly versions:

Nisse (extension) approach is:

Word of warning: Nisse features will most probably be absorbed into Maven 4, while Nisse remains Maven 3 extension. But be prepared for the future :smile:

@gnodet

cstamas commented 1 week ago

For ref https://issues.apache.org/jira/browse/MNG-8230

jimisola commented 6 days ago

We will jump on Maven 4 as soon as other plugins/extensions that we use have support for it.

There seem to have been a lot of activity around CI Friendly builds last 1-2 weeks as I followed the reference you provided. How far out is Maven 4 and do you expect Nisse features to be absorbed into the initial stable release of Maven 4?

Also, I reckon that the "dynamic versioning" goal that I contributed to MojoHaus Versions Maven plugin would still have to be implemented for Maven 4 and it would not be made available as default property sources in core but still as an extension. Correct?

I've allocated time for this during this and next work week, but I have no idea if enough time has been allocated since this something completely new for me.