Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-69076

parameter override for pom import not working as expected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • maven-plugin
    • None
    • Jenkins 2.332.4
      Maven Integration Plugin 3.19

      Project pom contains the following:

      <groupId>com.something</groupId>
      <artifactId>MyProject</artifactId>
      <version>${revision}</version>
      <packaging>jar</packaging>
      
      <properties>
          <revision>1.0-SNAPSHOT</revision>
          <bom.revision>${revision}</bom.revision>
      </properties>
      
      <dependencyManagement>
          <dependencies>
              <dependency>
                  <groupId>com.something</groupId>
                  <artifactId>MyProjectBom</artifactId>
                  <version>${bom.revision}</version>
                  <type>pom</type>
                  <scope>import</scope>
              </dependency>
          </dependencies>
      </dependencyManagement> 

      If I run the build without any overrides, job works fine; imports 1.0-SNAPSHOT bom version and creates 1.0-SNAPSHOT artifact.

      If I run with the following overridesĀ 

      -Drevision=2.0-SNAPSHOT -Dbom.revision=1.0-SNAPSHOT

      the job attempts to import the 2.0-SNAPSHOT version of the bom; the bom.revision override is ignored or overwritten by the <bom.revision>${revision}</bom.revision> default.

      If I remove the <bom.revision>${revision}</bom.revision> default, the job works as expected – 1.0-SNAPSHOT bom imported, 2.0-SNAPSHOT artifact created.

      When running the same configuration through Maven in my local Eclipse, the overrides work as expected.

            Unassigned Unassigned
            c3auer David Auer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: