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

Environment variables assigned to existing script variables

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'
        }
      }
      

            abayer Andrew Bayer
            kzantow Keith Zantow
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: