You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Niels Basjes <Ni...@basjes.nl> on 2022/02/17 16:45:19 UTC

Maven release and properties that refer to properties.

Hi,

I have a multi module project that I'm trying to release with the
maven-release-plugin.

In my project ( https://github.com/nielsbasjes/yauaa ) I have 2 maven
modules that are relevant for my question:
- a maven module with a library that does something that takes time.
- a maven module with benchmarking code to see how much faster/slower it
got.

In the pom.xml of the benchmarking code I have (simplified):

<properties>
  <yauaa.version>${project.version}</yauaa.version>
</properties>

and a dependency for the library (which is the library module of this
project)

<dependencies>
  <dependency>
    <groupId>nl.basjes.parse.useragent</groupId>
    <artifactId>yauaa</artifactId>
    <version>${yauaa.version}</version>
  </dependency>
</dependencies>

The reason I have this additional property is that now I can run my latest
benchmarks against older released versions of the library by simply
building it and overriding the yauaa.version property.
This works all as intended.

I'm trying out the maven-release-plugin on this project and when running
maven release:prepare I get this error:

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-release-plugin:3.0.0-M5:prepare
(default-cli) on project yauaa-parent:
     The artifact (nl.basjes.parse.useragent:yauaa) requires a different
version (6.10) than what is found (${project.version}) for the expression
(yauaa.version) in the project (nl.basjes.parse.useragent:yauaa-benchmark).
-> [Help 1]

I had a look at the code of the maven-release-plugin and it is clear that
this multi level usage of variables is not supported.

How can I achieve my idea of being able to run the benchmarks against older
versions without getting this error?

-- 
Best regards / Met vriendelijke groeten,

Niels Basjes