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