Set an environment variable named "Configuration" in pipeline

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Set an environment variable named "Configuration" in pipeline

Braden McDaniel
The conventional way of setting an environment variable in declarative pipeline seems to encounter a problem if the environment variable is named “Configuration”.  This code:

> environment {
>   Configuration="Release"
> }

…yields this error:

> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
> WorkflowScript: 22: you tried to assign a value to the class 'jenkins.model.Configuration'
>  @ line 22, column 25.
>                            Configuration="Release"
>                            ^

Is there some way to escape this name to avoid this collision?

The reason I care about this variable name is that I’m attempting to adapt a project that has been using a multi-configuration (matrix) job; and that job makes “Configuration” available as an environment variable (where it has been used in build scripts).

I am using Jenkins 2.176.1.

Braden McDaniel
<[hidden email]>

You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit