-1

The parent pom:

  <modelVersion>4.0.0</modelVersion>
  <groupId>xx.xxxx.xxxx.xx</groupId>
  <artifactId>parent-pom</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>

   <properties>
        <properties_deinfed_in_parent_pom>1.0.2-SNAPSHOT</properties_deinfed_in_parent_pom>
   </properties>

The child pom:

<parent>
  <groupId>xx.xxxx.xxxx.xx</groupId>
  <artifactId>parent-pom</artifactId>
  <version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>child-pom</artifactId>
<packaging>war</packaging>
<version>${properties_deinfed_in_parent_pom}</version>

which includes the parent pom, if I change the property properties_deinfed_in_parent_pom in parent pom, the version in child pom won't be updated. The only way I can update is using -Dxxx=value in maven command. I also checked the effective pom, it's also not updated. So will this idea work as my expectation, or what I thought was wrong.

I use Maven 3.3.x, IntelliJ 2018.1

iskohl
  • 3
  • 3

1 Answers1

0

The parent pom need to have the list of modules specified. Add the following to the parent pom

<modules> <module>child-pom</module> </modules>

Garima
  • 121
  • 4