Adrian Jackson wrote:

This would be a lot easier, of course, if we could define the version in a
single location rather than having to do so in every pom.xml - which makes
code reviews a nightmare as each review would contain changes to all the
poms which may or may not require checking by eye.

But it seems like there's no way of doing that: substituting variables
doesn't seem to work when specifying the parent version - ideally we'd like
to use a system variable to define the version.

Works for us. We have multi-module build, the root pom contains the canonical version, and the child poms access the version number by saying ${pom.version}.

In each child pom, don't declare a version at all, this means the version of the child will inherit from the parent.

When one child module depends on another child module, declare your dependency like this:

    <dependency>
      <groupId>alchemy</groupId>
      <artifactId>alchemy-client</artifactId>
      <version>${pom.version}</version>
    </dependency>

We release the entire multi module project in one go with release:prepare / release:perform.

Regards,
Graham
--

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to