apache / apache/maven-deploy-plugin

deploy-file incompatible with "CI-friendly" versions

Open
#649 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
78
Forks
76
Avg merge
2d 11h
Merged PRs (30d)
12

Description

### 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 `` 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
```
${revision}
```
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`?

Contributor guide

No contributing guide indexed for this repository

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.