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

MY_JAR_ARTIFACT_URL wrong if MY_JAR_VERSION passed from trigger job

    XMLWordPrintable

Details

    Description

      If a "trigger job" triggers a downstream job with a build param of type Maven Metadata Plugin,
      the passed build param "MY_JAR_VERSION" isn´t reflected properly in MY_JAR_ARTIFACT_URL.

      MY_JAR_ARTIFACT_URL is composed out of the parameters if the job would have been triggered manually - with a (default) selection of a version.

      Example:
      the trigger job passes MY_JAR_VERSION=1 to the downstream project.
      When inspecting "Parameters" of the downstream project we´ll see these properties:

      MY_JAR_ARTIFACT_VERSION=3 (latest release, default)
      MY_JAR_ARTIFACT_PACKAGING=...
      MY_JAR_ARTIFACT_URL=/path/to/repo/groupId/artifactId/3/artifactId-3.packaging
      MY_JAR_ARTIFACT_VERSION=1 (passed from trigger job)
      

      => For that, MY_JAR_ARTIFACT_URL needs to be created programmatically by concatinating all parts to a valid (Nexus) URL:

      COMPONENT_ARTIFACT_URL_FIXED="${REPO_BASE_URL}/${COMPONENT_GROUP_ID//.//}/${COMPONENT_ARTIFACT_ID}/${COMPONENT_VERSION}/${COMPONENT_ARTIFACT_ID}-${COMPONENT_VERSION}.${COMPONENT_PACKAGING}"
      

      Expected behaviour is COMPONENT_ARTIFACT_URL will always reflect the correct URL - regardingless of the version being choosen by a user or passed as build parameter from a trigger job.

      Attachments

        Activity

          torstenreinhard Torsten Reinhard created issue -
          torstenreinhard Torsten Reinhard made changes -
          Field Original Value New Value
          Description If a "trigger job" triggers a downstream job with a build param of type Maven Metadata Plugin,
          the passed build param "MY_JAR_VERSION" isn´t reflected properly in MY_JAR_ARTIFACT_URL.

          MY_JAR_ARTIFACT_URL is composed out of the parameters if the job would have been triggered manually - with a (default) selection of a version.

          Example:
          the trigger job passes MY_JAR_VERSION=1 to the downstream project.
          When inspecting "Parameters" of the downstream project we´ll see these properties:
          MY_JAR_ARTIFACT_VERSION=3 (latest release, default)
          MY_JAR_ARTIFACT_PACKAGING=...
          MY_JAR_ARTIFACT_URL=/path/to/repo/groupId/artifactId/3/artifactId-3.packaging
          MY_JAR_ARTIFACT_VERSION=1 (passed from trigger job)

          => For that, MY_JAR_ARTIFACT_URL needs to be created programmatically by concatinating all parts to a valid (Nexus) URL:

          COMPONENT_ARTIFACT_URL_FIXED="${REPO_BASE_URL}/${COMPONENT_GROUP_ID//.//}/${COMPONENT_ARTIFACT_ID}/${COMPONENT_VERSION}/${COMPONENT_ARTIFACT_ID}-${COMPONENT_VERSION}.${COMPONENT_PACKAGING}"

          Expected behaviour is COMPONENT_ARTIFACT_URL will always reflect the correct URL - regardingless of the version being choosen by a user or passed as build parameter from a trigger job.
          If a "trigger job" triggers a downstream job with a build param of type Maven Metadata Plugin,
          the passed build param "MY_JAR_VERSION" isn´t reflected properly in MY_JAR_ARTIFACT_URL.

          MY_JAR_ARTIFACT_URL is composed out of the parameters if the job would have been triggered manually - with a (default) selection of a version.

          Example:
          the trigger job passes MY_JAR_VERSION=1 to the downstream project.
          When inspecting "Parameters" of the downstream project we´ll see these properties:
          {code}
          MY_JAR_ARTIFACT_VERSION=3 (latest release, default)
          MY_JAR_ARTIFACT_PACKAGING=...
          MY_JAR_ARTIFACT_URL=/path/to/repo/groupId/artifactId/3/artifactId-3.packaging
          MY_JAR_ARTIFACT_VERSION=1 (passed from trigger job)
          {code}

          => For that, MY_JAR_ARTIFACT_URL needs to be created programmatically by concatinating all parts to a valid (Nexus) URL:

          {code}
          COMPONENT_ARTIFACT_URL_FIXED="${REPO_BASE_URL}/${COMPONENT_GROUP_ID//.//}/${COMPONENT_ARTIFACT_ID}/${COMPONENT_VERSION}/${COMPONENT_ARTIFACT_ID}-${COMPONENT_VERSION}.${COMPONENT_PACKAGING}"
          {code}

          Expected behaviour is COMPONENT_ARTIFACT_URL will always reflect the correct URL - regardingless of the version being choosen by a user or passed as build parameter from a trigger job.
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 170300 ] JNJira + In-Review [ 183848 ]

          People

            gesh Gesh Markov
            torstenreinhard Torsten Reinhard
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: