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

JDK Parameter and Label Parameter are null from params variable

      println params

      {sessionKey=8900978c-f00a-4d19-b67c-229411f75886, test=test, NODE=null, jdkVersion=null}

      So text and other parameters are set.   But the Label Parameter and the JDK Parameters are not accessible.

      Wanted to log this while I'm still investigating.   So fare these show up as null when tested.

      • org.jvnet.jenkins.plugins.nodelabelparameter.LabelParameterValue
      • org.jvnet.jenkins.plugins.nodelabelparameter.NodeParameterValue
      • com.datalex.jdkparameter.JavaParameterValue

          [JENKINS-73317] JDK Parameter and Label Parameter are null from params variable

          Michael Carter added a comment - - edited

          Did some experimenting adding this can basically fix it.

           

              @Exported(visibility = 3)
              private String selectedJDK;    
          
              @DataBoundConstructor
              public JavaParameterValue(String name, String description, String selectedJDK){
                  super(name, description);
                  this.selectedJDK = selectedJDK;
              }
          
              public Object getValue() {
                return selectedJDK;
              }
              
              @Override
              public void buildEnvironment(Run<?, ?> build, EnvVars env) {
                  env.put(name, selectedJDK);
              }
              

           

          Michael Carter added a comment - - edited Did some experimenting adding this can basically fix it.       @Exported(visibility = 3)     private String selectedJDK;    @DataBoundConstructor     public JavaParameterValue( String name, String description, String selectedJDK){         super (name, description);         this .selectedJDK = selectedJDK;     }     public Object getValue() {       return selectedJDK;     }          @Override     public void buildEnvironment(Run<?, ?> build, EnvVars env) {         env.put(name, selectedJDK);     }       

            Unassigned Unassigned
            mikeycarter Michael Carter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: