The withEnv step should accept a java.util.{{Map}}, which is the natural form of an environment variable list. It expects a java.util.List, and dies with

      java.lang.UnsupportedOperationException: must specify $class with an implementation of interface java.util.List
      	at org.jenkinsci.plugins.structs.describable.DescribableModel.resolveClass(DescribableModel.java:503)
        ...
      Caused: java.lang.IllegalArgumentException: Could not instantiate {overrides={}} for EnvStep(overrides: String[])
        ...
      

      if a Map is passed.

          [JENKINS-54930] withEnv should accept Map as well as List

          Craig Ringer created issue -
          Craig Ringer made changes -
          Description Original: The `withEnv` step should accept a Map, which is the natural form of an environment variable list. It expects a `java.util.List`, and dies with

          {code}
          java.lang.UnsupportedOperationException: must specify $class with an implementation of interface java.util.List
          at org.jenkinsci.plugins.structs.describable.DescribableModel.resolveClass(DescribableModel.java:503)
            ...
          Caused: java.lang.IllegalArgumentException: Could not instantiate {overrides={}} for EnvStep(overrides: String[])
            ...
          {code}

          if a Map is passed.
          New: The {{withEnv}} step should accept a java.util.{{Map}}, which is the natural form of an environment variable list. It expects a {{java.util.List}}, and dies with
          {code:java}
          java.lang.UnsupportedOperationException: must specify $class with an implementation of interface java.util.List
          at org.jenkinsci.plugins.structs.describable.DescribableModel.resolveClass(DescribableModel.java:503)
            ...
          Caused: java.lang.IllegalArgumentException: Could not instantiate {overrides={}} for EnvStep(overrides: String[])
            ...
          {code}
          if a {{Map}} is passed.
          Craig Ringer made changes -
          Description Original: The {{withEnv}} step should accept a java.util.{{Map}}, which is the natural form of an environment variable list. It expects a {{java.util.List}}, and dies with
          {code:java}
          java.lang.UnsupportedOperationException: must specify $class with an implementation of interface java.util.List
          at org.jenkinsci.plugins.structs.describable.DescribableModel.resolveClass(DescribableModel.java:503)
            ...
          Caused: java.lang.IllegalArgumentException: Could not instantiate {overrides={}} for EnvStep(overrides: String[])
            ...
          {code}
          if a {{Map}} is passed.
          New: The {{withEnv}} step should accept a {{java.util.{{Map}}}}, which is the natural form of an environment variable list. It expects a {{java.util.List}}, and dies with
          {code:java}
          java.lang.UnsupportedOperationException: must specify $class with an implementation of interface java.util.List
          at org.jenkinsci.plugins.structs.describable.DescribableModel.resolveClass(DescribableModel.java:503)
            ...
          Caused: java.lang.IllegalArgumentException: Could not instantiate {overrides={}} for EnvStep(overrides: String[])
            ...
          {code}
          if a {{Map}} is passed.

          Devin Nusbaum added a comment -

          I ran into this issue and JENKINS-46124 while looking into something related to JENKINS-28510. I am going to close this as a dupe of the former because that issue has some comments and was filed earlier.

          Devin Nusbaum added a comment - I ran into this issue and JENKINS-46124 while looking into something related to JENKINS-28510 . I am going to close this as a dupe of the former because that issue has some comments and was filed earlier.
          Devin Nusbaum made changes -
          Link New: This issue duplicates JENKINS-46124 [ JENKINS-46124 ]
          Devin Nusbaum made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

          Joseph Petersen (old) added a comment - Created  https://github.com/jenkinsci/workflow-basic-steps-plugin/pull/105
          Joseph Petersen (old) made changes -
          Remote Link New: This issue links to "workflow-basic-steps-plugin #105 (Web Link)" [ 24346 ]

            Unassigned Unassigned
            ringerc Craig Ringer
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: