Skip to content

deploy-file incompatible with "CI-friendly" versions #649

@shoffmeister

Description

@shoffmeister

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions