You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nils Breunese <ni...@breun.nl> on 2025/03/10 15:05:02 UTC
project.version evaluates to different value with Maven 4.0.0-rc-3
Hello,
With Maven 3.9.9 I’m using a command like this to find the version of a project on the command line:
❯ mvn3 help:evaluate --quiet -DforceStdout=true -Dexpression=project.version
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: /opt/local/share/java/maven3
Java version: 21.0.6, vendor: Azul Systems, Inc., runtime: /opt/local/Library/Java/JavaVirtualMachines/jdk-21-azul-zulu.jdk/Contents/Home
Default locale: nl_NL, platform encoding: UTF-8
OS name: "mac os x", version: "15.3.1", arch: "aarch64", family: "mac"
14.2.0-SNAPSHOT%
This project’s root pom.xml contains <version>${revision}</version> and has this property: <revision>14.2.0-SNAPSHOT<revision>, so I indeed expect this to return 14.2.0-SNAPSHOT.
However, with Maven 4.0.0-rc-3 I get the following output on the exact same repository:
❯ mvn4 help:evaluate --quiet -DforceStdout=true -Dexpression=project.version
4.0.0-rc-2
Now, I like that the Maven 4 output is more quiet, but I’m surprised that the project version value is suddenly different. I’d say Maven 3 is correct, and I have no idea where this '4.0.0-rc-2' value comes from (it is not present in the code base at all). It seems suspicious that this value is almost, but not exactly (rc-2 vs rc-3), the Maven version.
Any ideas?
Nils.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: project.version evaluates to different value with Maven 4.0.0-rc-3
Posted by Nils Breunese <ni...@breun.nl>.
I’m sorry for the confusion, mvn4 was still pointing to Maven 4.0.0-rc-2 when I ran that command below. With Maven 4.0.0-rc-3 the output is 4.0.0-rc-3, but I still don’t expect that command to return Maven’s version instead of the project’s version.
Nils.
> Op 10 mrt 2025, om 16:05 heeft Nils Breunese <ni...@breun.nl> het volgende geschreven:
>
> Hello,
>
> With Maven 3.9.9 I’m using a command like this to find the version of a project on the command line:
>
> ❯ mvn3 help:evaluate --quiet -DforceStdout=true -Dexpression=project.version
> Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
> Maven home: /opt/local/share/java/maven3
> Java version: 21.0.6, vendor: Azul Systems, Inc., runtime: /opt/local/Library/Java/JavaVirtualMachines/jdk-21-azul-zulu.jdk/Contents/Home
> Default locale: nl_NL, platform encoding: UTF-8
> OS name: "mac os x", version: "15.3.1", arch: "aarch64", family: "mac"
> 14.2.0-SNAPSHOT%
>
> This project’s root pom.xml contains <version>${revision}</version> and has this property: <revision>14.2.0-SNAPSHOT<revision>, so I indeed expect this to return 14.2.0-SNAPSHOT.
>
> However, with Maven 4.0.0-rc-3 I get the following output on the exact same repository:
>
> ❯ mvn4 help:evaluate --quiet -DforceStdout=true -Dexpression=project.version
> 4.0.0-rc-2
>
> Now, I like that the Maven 4 output is more quiet, but I’m surprised that the project version value is suddenly different. I’d say Maven 3 is correct, and I have no idea where this '4.0.0-rc-2' value comes from (it is not present in the code base at all). It seems suspicious that this value is almost, but not exactly (rc-2 vs rc-3), the Maven version.
>
> Any ideas?
>
> Nils.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org