Skip to content

Inject version as a property in versioned pom, independently of branch/tag? #380

@DidierLoiseau

Description

@DidierLoiseau

Sometimes child projects (in other repositories) which use our pom as parent may need to actually use the version of our pom for other things, such as configuring some plugin (e.g. to specify a version of a dependency we publish, and that will be used directly by the plugin).

It would thus be useful to define a property like <parent-pom.version> that child projects could reference as needed (a bit like Spring Boot used to have one, see spring-projects/spring-boot#5014 – with the known limitations it had, e.g. you obviously can’t override it). This would be convenient so that the child projects only need to update the version of the parent, and not any other property.

I have noticed that you can do that with <properties>, but it seems to have some limitations:

  1. you need to declare it in maven-git-versioning-extension.xml – we use a shared configuration so it is a bit annoying
  2. you need to specify it for each branch/tag pattern

Is there another way to inject the computed version in the versioned pom? If not, is there a way to declare the property only once?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions