I have the following parent pom
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test.test</groupId>
<artifactId>artifact-id</artifactId>
<version>${revision}</version>
<modules>
<module>child1</module>
<module>child2</module>
</modules>
<packaging>pom</packaging>
<properties>
<revision>1.0.0-SNAPSHOT</revision>
<properties>
<build>
<finalName>${project.artifactId}-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${flatten.version}</version>
<configuration>
<updatePomFile>true</updatePomFile>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
... and child pom:
<parent>
<groupId>com.test.test</groupId>
<artifactId>artifact-id</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>child-pom</artifactId>
And I want to build the project from Jenkins with -Drevision=.... So far so good, but in the maven repository (local one) the pom file of the child is with ${revision}
in it so it can't be resolved later. The flatten plugin produces some pom xml files but they are not used obviously. Any suggestions how can I fix that?
Also it will be great if I'm able to build each child module separately from the parent.
Maven - 3.5.3
Java - 8
and I have a shade plugin in the parent pom too.