I have a multimodule project, in which i am defining the project version in the parent and using that property to be consumed in the child pom as below. Seems like maven deploy plugin is not able to pick the property from parent pom.
Parent pom :
<modelVersion>4.0.0</modelVersion>
<!-- =================================================================== -->
<!-- == Parent == -->
<!-- =================================================================== -->
<parent>
<groupId>com.test.parent</groupId>
<artifactId>archetype-parent</artifactId>
<version>LATEST-SNAPSHOT</version>
</parent>
<!-- =================================================================== -->
<!-- == Properties == -->
<!-- =================================================================== -->
<properties>
<jaxb.api.version>2.3.0</jaxb.api.version>
<jaxb.impl.version>2.3.0</jaxb.impl.version>
<app.version>LATEST-SNAPSHOT</app.version>
</properties>
<!-- =================================================================== -->
<!-- == This Artifact == -->
<!-- =================================================================== -->
<groupId>com.igaurav</groupId>
<artifactId>integration</artifactId>
<packaging>pom</packaging>
<version>${app.version}</version>
<!-- =================================================================== -->
<!-- == Modules == -->
<!-- =================================================================== -->
<modules>
<module>modules</module>
<module>services</module>
</modules>
Service child pom :
<!-- =================================================================== -->
<!-- == Parent == -->
<!-- =================================================================== -->
<parent>
<groupId>com.igaurav</groupId>
<artifactId>integration</artifactId>
<version>${app.version}</version>
</parent>
<!-- =================================================================== -->
<!-- == This Artifact == -->
<!-- =================================================================== -->
<groupId>com.igaurav</groupId>
<artifactId>services</artifactId>
<packaging>pom</packaging>
<version>${app.version}</version>
<properties>
<jdk.version>11</jdk.version>
<maven.compiler.target>${jdk.version}</maven.compiler.target>
<maven.compiler.source>${jdk.version}</maven.compiler.source>
</properties>
Module child pom is also similar to service child pom .
For me compilation steps(mvn clean install) works properly with no error but while the below command is executed to deploy the artifact via using maven deploy plugin.
mvn -e -f pom.xml flatten:clean flatten:flatten -B org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M1:deploy-file -Durl={repositrypath} -DrepositoryId={repositoryId}-Dfile=pom.xml -DpomFile=/pom.xml -DgeneratePom=false
Error :
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M1:deploy-file (default-cli) on project integration: Failed to deploy artifacts: Could not transfer artifact com.igaurav:integration:pom:${app.version} from/to spartafactory (url): Transfer failed for {urlPath}/integration/$%257Bapp.version%257D/integration-$%257Bapp.version%257D.pom 409 Conflict
Issue here is that it is not converting the app.version into LATEST-SNAPSHOT and just reading it as it is.