Skip to content

otherDeploymentBranchPattern doesn't work with multi-module builds and ${project.version} #105

Open
@robth

Description

@robth

When a branch matches otherDeploymentBranchPattern, the normalized branch name will be appended to the POM version. Under the hood, the plugin uses project.setVersion() to set the version. It does not change the POM.

For multi-module builds and builds that use ${project.version}, this causes problems since parent versions and ${project.version} are not set to the correct version (i.e. the version including the branch name).

For example, a module referencing its parent:

<parent>
  <groupId>test</groupId>
  <artifactId>parent</artifactId>
  <version>1.0.0-SNAPSHOT</version> <!-- Note that the branch name is missing -->
</parent>

For example, a (parent) POM with dependency management of its modules:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>test</groupId>
      <artifactId>module1</artifactId>
      <version>${project.version}</version> <!-- Note that project.version won't contain the branch name -->
    </dependency>
  </dependencies>
</dependencyManagement>

I don't see a simple way to solve this, or am I missing something?
The only solution I see is to change the POM file. That can be done either by the user (see #83), or automatically by the plugin.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions