Howdy, While Maven4 plans to be as compatible as possible with Maven3 plugins, the topic of extensions is difficult, as they reach into Maven internals...
In short, the extension is not compatible with Maven4 due this "trick": https://github.com/qoomon/maven-git-versioning-extension/blob/master/src/main/java/me/qoomon/maven/gitversioning/GitVersioningModelProcessor.java To properly support Maven4, this extension would need to be "enabled" for Maven4, very similar like Nisse was recently: https://github.com/maveniverse/nisse/commit/a24a8e90e39d50ae479e5e3e92b6ad643849e147#diff-eaf45ebe6b14a5aaad3400949a1a9a22c8b09f49acc9683dbb28eaf21bf93895 In short: Maven4 PropertyContributor SPI should be used instead. PS: If needed, I may try to craft a PR for this extension to make it Maven4 friendly, just ping me. HTH Tamas On Mon, Dec 16, 2024 at 4:21 PM Thorsten Heit <th...@gmx.de.invalid> wrote: > > Hi, > > In a multi-module project we're using the maven-git-versioning-extension > to automagically create the version number for the build. The extension > is declared in .mvn/extensions.xml: > > <?xml version="1.0" encoding="UTF-8" standalone="no"?> > <extensions xmlns="http://maven.apache.org/EXTENSIONS/1.1.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > schemaLocation="http://maven.apache.org/EXTENSIONS/1.1.0 > https://maven.apache.org/xsd/core-extensions-1.1.0.xsd"> > <extension> > <groupId>me.qoomon</groupId> > <artifactId>maven-git-versioning-extension</artifactId> > <version>9.10.0</version> > </extension> > </extensions> > > Additionally there's a .mvn/maven.config file having the following content: > > -Drevision=1.0.0-SNAPSHOT > > > Using Maven 3 (3.9.9 actually) the following output is shown: > > > $ mvn3 initialize > [INFO] Scanning for projects... > [INFO] > [INFO] --- me.qoomon:maven-git-versioning-extension:9.10.0 [core > extension] --- > [INFO] matching ref: BRANCH - main > [INFO] ref configuration: BRANCH - pattern: .+ > [INFO] describeTagFirstParent: true > [INFO] version: > ${describe.tag}${describe.distance:+-}${describe.distance:-}${dirty} > [INFO] properties: > [INFO] project.build.outputTimestamp - ${commit.timestamp} > [INFO] > (...) > [INFO] > ------------------------------------------------------------------------ > [INFO] Reactor Build Order: > (...) > [INFO] Building Testserver 1.1.8-3-DIRTY [1/11] > (...) > > i.e. the version number is calculated based on the latest Git tag, > commit difference and local modifications, as expected. > > > With Maven 4.0.0-rc1 the extension doesn't seem to be activated: > > > $ mvn4 initialize > [WARNING] > [WARNING] Some problems were encountered while building the effective > settings > [WARNING] Pre-Maven 4 legacy encrypted password detected - configure > password encryption with the help of mvnenc to be compatible with Maven > 4. @ C:\Users\thoh\.m2\settings.xml > [WARNING] Pre-Maven 4 legacy encrypted password detected - configure > password encryption with the help of mvnenc to be compatible with Maven > 4. @ C:\Users\thoh\.m2\settings.xml > [WARNING] Pre-Maven 4 legacy encrypted password detected - configure > password encryption with the help of mvnenc to be compatible with Maven > 4. @ C:\Users\thoh\.m2\settings.xml > [WARNING] > [WARNING] > [WARNING] Some problems were encountered while building the effective > settings > [WARNING] Pre-Maven 4 legacy encrypted password detected - configure > password encryption with the help of mvnenc to be compatible with Maven > 4. @ C:\Users\thoh\.m2\settings.xml > [WARNING] Pre-Maven 4 legacy encrypted password detected - configure > password encryption with the help of mvnenc to be compatible with Maven > 4. @ C:\Users\thoh\.m2\settings.xml > [WARNING] Pre-Maven 4 legacy encrypted password detected - configure > password encryption with the help of mvnenc to be compatible with Maven > 4. @ C:\Users\thoh\.m2\settings.xml > [WARNING] > [INFO] Scanning for projects... > [INFO] > -------------------------------------------------------------------------------------------------------------- > [INFO] Reactor Build Order: > (...) > [INFO] Building Testserver 1.0.0-SNAPSHOT > [1/11] > [INFO] from pom.xml > [INFO] ---------------------------------------------------[ pom > ]---------------------------------------------------- > [INFO] > > As you can see the version number is *not* calculated by the extension > but instead by using the "hardcoded" value given in .mvn/maven.config > via the revision property. > > > I don't see any error messages saying that the plugin could not be > loaded/activated etc. so I'm a bit lost. > > Can someone shed a light on what's going on here? Is this intentional? > Or perhaps a bug? A quick search in JIRA didn't help... > > > > PS: The version number isn't coded in the pom.xml itself; instead I'm > using <version>${revision}</version>. > > > > Regards > > > Thorsten > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org