Pom.xml question: project.version or gs.version guidance?

I have been building random community modules as I backport some fixes from GeoServer 3.0.0-SNAPSHOT.

And I have a question - what is preferable to use?

Use project.version:

    <dependency>
      <groupId>org.geoserver.community</groupId>
      <artifactId>gs-web-dggs</artifactId>
      <version>${project.version}</version>
    </dependency>

Or use gs.version:

    <dependency>
      <groupId>org.geoserver.community</groupId>
      <artifactId>gs-web-ogcapi</artifactId>
      <version>${gs.version}</version>
    </dependency>

Some community “assembly” pom.xml` files have both…

The property gs.version is defined in the root pom.xml and I cannot think of a reason this would ever not match project.version? It primarily seems to be used in assembly modules.

Is it okay to get rid of gs.version or does it have a use I cannot figure out?

the root pom uses ${gs.version} extensively in dependencyManagement as well, there might be a catch where this cannot be ${project.version} for Maven resolver reasons… my memory is vague on that

A quick way to check/validate might be to replace <gs.version>3.0.0-SNAPSHOT</gs.version> with <gs.version>${project.version}</gs.version>

The two settings are redundant, I expect it may be from community modules developed independely and then donated to the geoserver repo?

Here is a PR to test removing gs.version:

In our project, we also have that redundancy long time ago, but someone left this comment:

<!-- This redundant version definition is important to simplify solution inheritance -->
    <nw.version>${project.version}</nw.version>

We have a product, that some customization solutions can depend on.

Probably this is old code style, because today the inheritance is through a separated BOM and not the root pom.

:face_with_peeking_eye: