Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-20215

Version property is not replaced with a value defined in parent pom

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • 4.3.x
    • 4.3.0.Alpha1
    • maven, upstream
    • None

      Consider this situation:
      There is a parent pom where a version property is defined.

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          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>jira</groupId>
          <artifactId>jira-reproducer-parent</artifactId>
          <version>1.0</version>
          <packaging>pom</packaging>
      
          <properties>
              <reproducer.child.version>1.1.Final</reproducer.child.version>
          </properties>
      
      </project>
      

      Then there is a child pom and version of this pom is the property defined in the parent pom.

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          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>
          <parent>
              <groupId>jira</groupId>
              <artifactId>jira-reproducer-parent</artifactId>
              <version>1.0</version>
              <relativePath>../pom.xml</relativePath>
          </parent>
      
          <artifactId>jira-reproducer-child</artifactId>
          <version>${reproducer.child.version}</version>
      
      </project>
      

      Then the generated pom at target/classes/META-INF/maven/jira/jira-reproducer-child/pom.xml doesn't contain the replaced value from the parent pom, but the original property:

      <version>${reproducer.child.version}</version>
      

      should be:

      <version>1.1.Final</version>
      

            Unassigned Unassigned
            mjobanek Matous Jobanek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: