Environment variables assigned to existing script variables

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      This pipeline script appears to be attempting to assign the value for what should be a User variable in the script environment to an existing groovy script variable, resulting in this error: you tried to assign a value to the class 'hudson.model.User' @ line 11, column 5.

      Perhaps this is expected behavior? I would assume these variables should be in the context of env. Maybe this is a special case?

      pipeline {
        agent any
        stages {
          stage('Build') {
            steps {
              sh('mvn package')
            }
          }
        }
        environment {
          User = 'asdf'
        }
      }
      

            Assignee:
            Andrew Bayer
            Reporter:
            Keith Zantow
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: