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

JDK Parameter Plugin 1.1 no longer recognizes selectedJDK attribute

    • 1.2

      After upgrading to 1.1, this piece of pipeline code:

      build job: "some_job", propagate: false, parameters: [
                          string(name: 'milestone', value: buildingMilestone),
                          string(name: 'mavenExtras', value: toBuild.mavenExtras),
                          string(name: 'branch', value: thisBranch), 
                          [$class: 'NodeParameterValue', name: 'buildLabel', labels: [toBuild.label], nodeEligibility: [$class: 'AllNodeEligibility']],
                          [$class: 'JavaParameterValue', name: 'jdkVersion', selectedJDK: jdkVersion],
                          booleanParam(name: 'cleanWorkspace', value: toBuild.cleanWorkspace)
                      ]

      Issues this warning, and then "some job" doesn't get the right version of the JDK.

      WARNING: Unknown parameter(s) found for class type 'com.datalex.jdkparameter.JavaParameterValue': selectedJDKScheduling project: EventProcessing » parent.java11.linuxThe parameter 'jdkVersion' did not have the type expected by EventProcessing » parent.java11.linux. Converting to JDK Parameter.

      It looks like the selectedJDK parameter disappeared from 1.1 on purpose. It's a breaking change - how do we get the code above to get the right JDK version passed into the job we are trying to build?

      Here's one place where it used to be:

      https://github.com/jenkinsci/JDK_Parameter_Plugin-plugin/blob/JDK_Parameter_Plugin-1.0/src/main/resources/com/datalex/jdkparameter/JavaParameterValue/value.jelly

          [JENKINS-70309] JDK Parameter Plugin 1.1 no longer recognizes selectedJDK attribute

          Robert created issue -
          Robert made changes -
          Description Original: After upgrading to 1.1, this piece of pipeline code:

          {{build job: "some_job", propagate: false, parameters: [}}
          {{                    string(name: 'milestone', value: buildingMilestone),}}
          {{                    string(name: 'mavenExtras', value: toBuild.mavenExtras),}}
          {{                    string(name: 'branch', value: thisBranch), }}
          {{                    [$class: 'NodeParameterValue', name: 'buildLabel', labels: [toBuild.label], nodeEligibility: [$class: 'AllNodeEligibility']],}}
          {{                    [$class: 'JavaParameterValue', name: 'jdkVersion', selectedJDK: jdkVersion],}}
          {{                    booleanParam(name: 'cleanWorkspace', value: toBuild.cleanWorkspace)}}
          {{                ]}}

          Issues this warning, and then "some job" doesn't get the right version of the JDK.

          {{{}WARNING: Unknown parameter(s) found for class type 'com.datalex.jdkparameter.JavaParameterValue': selectedJDK{}}}{{{}Scheduling project: EventProcessing » parent.java11.linux{}}}{{{}The parameter 'jdkVersion' did not have the type expected by EventProcessing » parent.java11.linux. Converting to JDK Parameter.{}}}

          It looks like the selectedJDK parameter disappeared from 1.1 on purpose. It's a breaking change - how do we the code above to get the right JDK version passed into the job we are trying to build?

          Here's one place where it used to be:

          [https://github.com/jenkinsci/JDK_Parameter_Plugin-plugin/blob/JDK_Parameter_Plugin-1.0/src/main/resources/com/datalex/jdkparameter/JavaParameterValue/value.jelly]
          New: After upgrading to 1.1, this piece of pipeline code:

          {{build job: "some_job", propagate: false, parameters: [}}
          {{                    string(name: 'milestone', value: buildingMilestone),}}
          {{                    string(name: 'mavenExtras', value: toBuild.mavenExtras),}}
          {{                    string(name: 'branch', value: thisBranch), }}
          {{                    [$class: 'NodeParameterValue', name: 'buildLabel', labels: [toBuild.label], nodeEligibility: [$class: 'AllNodeEligibility']],}}
          {{                    [$class: 'JavaParameterValue', name: 'jdkVersion', selectedJDK: jdkVersion],}}
          {{                    booleanParam(name: 'cleanWorkspace', value: toBuild.cleanWorkspace)}}
          {{                ]}}

          Issues this warning, and then "some job" doesn't get the right version of the JDK.

          {{{}WARNING: Unknown parameter(s) found for class type 'com.datalex.jdkparameter.JavaParameterValue': selectedJDK{}}}{{{}Scheduling project: EventProcessing » parent.java11.linux{}}}{{{}The parameter 'jdkVersion' did not have the type expected by EventProcessing » parent.java11.linux. Converting to JDK Parameter.{}}}

          It looks like the selectedJDK parameter disappeared from 1.1 on purpose. It's a breaking change - how do we get the code above to get the right JDK version passed into the job we are trying to build?

          Here's one place where it used to be:

          [https://github.com/jenkinsci/JDK_Parameter_Plugin-plugin/blob/JDK_Parameter_Plugin-1.0/src/main/resources/com/datalex/jdkparameter/JavaParameterValue/value.jelly]
          Robert made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]
          Mark Waite made changes -
          Remote Link New: This issue links to "PR-5 -Restore selectedJDK parameter (Web Link)" [ 28403 ]
          Mark Waite made changes -
          Assignee New: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Mark Waite made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Mark Waite made changes -
          Remote Link New: This issue links to "CI job with most recent successful build of pull request (Web Link)" [ 28414 ]
          Mark Waite made changes -
          Released As New: 1.2
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Closed [ 6 ]

            markewaite Mark Waite
            rpk_pro Robert
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: