deploy-file incompatible with "CI-friendly" versions

Open
#649 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
build-system

Research direction

Start with the deploy-file goal and the Maven CI Friendly Versions guide, then inspect how it reads pom.xml and the adjacent pom.properties. Confirm the desired precedence between resolved properties and POM values, and verify that an artifact built with -Drevision=1.2.3 can be deployed with the resolved coordinates.

Written by the indexing model from the issue text.

Description

bug
Affected version

3.1.4

Bug description

The deploy-file goal is very helpful in trying to use an embedded POM whenever it is present (only) with a JAR. To that extent, indeed, #583 / https://issues.apache.org/jira/browse/MDEPLOY-178 seems to have been resolved.

Alas, the implementation is not compatible with Maven CI Friendly Versions,
https://maven.apache.org/guides/mini/guide-maven-ci-friendly.html

Fundamentally, when using Maven CI Friendly Versions, the <version> element of the pom.xml does not contain the final version of the artifact, but will contain variables (properties) for substitution - for instance ${revision} -, yielding

    <version>${revision}</version>

as the version.

And that is something that deploy-file does not like, for obvious reasons.

Instead of (only) looking at the pom.xml content, deploy-file should also look at the content found in the adjacent file pom.properties which contains

artifactId=test-artifact
groupId=test.groupid
version=1.2.3

i.e. the resolved version information (having built with mvn -Drevision=1.2.3 clean package)

Thinking further ahead, it may even better if deploy-file preferred any content in pom.properties over whatever is found in pom.xml?

Dominant language
Java
Stars
78
Forks
76
Avg merge
2d 5h
Merged PRs (30d)
13

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/maven-deploy-plugin

All issues in apache/maven-deploy-plugin

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.