Skip to content

Preserve property references when using release:prepare goal with autoResolveSnapshots parameter #1470

@rcmul

Description

@rcmul

New feature, improvement proposal

I have property references to snapshot dependencies in my project

...
<properties>
  <dep.version>1.0.0-SNAPSHOT</dep.version>
</properties> 
...
<dependency>
  <groupId>dep</groupId>
  <artifactId>dep1</artifactId>
  <version>${dep.version}</version>
</dependency>
<dependency>
  <groupId>dep</groupId>
  <artifactId>dep2</artifactId>
  <version>${dep.version}</version>
</dependency>
...

When I run the release:prepare goal with the autoResolveSnapshots parameter set, the plugin correctly infers that the property referenced in the dependency section is a snapshot that needs to be resolved, but it removes the references and makes inline updates for each dependency while leaving the now-unreferenced property unchanged.

...
<properties>
  <dep.version>1.0.0-SNAPSHOT</dep.version>
</properties>
...
<dependency>
  <groupId>dep</groupId>
  <artifactId>dep1</artifactId>
  <version>1.0.0</version>
</dependency>
<dependency>
  <groupId>dep</groupId>
  <artifactId>dep2</artifactId>
  <version>1.0.0</version>
</dependency>
...

Can the autoResolveSnapshots functionality be changed so that property references are preserved during resolution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions