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: [email protected] For additional commands, e-mail: [email protected]
