artifact version in the dependency-reduced-pom generated by maven-shade-plugin

45 views Asked by At

I have a maven project using the maven-shade-plugin. The project's pom.xml defined the project version as

    <groupId>com.company</groupId>
    <artifactId>server</artifactId>
    <packaging>jar</packaging>
    <version>${revision}</version>
    <name>Server</name>
    <url>http://maven.apache.org</url>
    <properties>
        <revision>3.0.1-SNAPSHOT</revision>
    </properties>

When we run the maven build, we pass in the revision

mvn -B -Drevision=${{ env.ARTIFACT_VERSION }}-${{ github.run_number }} install verify deploy

The problem is when maven-shade-plugin generated the dependency-reduced-pom.xml, it is not reading the -Drevision=... from the system parameter. The dependency-reduced-pom.xml has

 <version>${revision}</version>

Any suggestions to fix this issue? Thanks.

0

There are 0 answers