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

Generator parameters not replaced in *system* groovy scripts

    XMLWordPrintable

Details

    Description

      Using the groovy script plugin, I can refer to generator parameters in the script using a macro notation eg:
      def aGeneratorParam = "$aGeneratorParam"

      In system groovy scripts, this does not work, and there's no way to access the generator parameters.

      (I could use environment variable injection to save the generator parameters into the jobs environment, but that's not nice)

      Attachments

        Activity

          timor_raiman Timor Raiman added a comment -

          The correct syntax is:
          def aGeneratorParam = "${aGeneratorParam}"

          It must the be curly braces that trigger macro replacement, $ alone is not enough.

          timor_raiman Timor Raiman added a comment - The correct syntax is: def aGeneratorParam = "${aGeneratorParam}" It must the be curly braces that trigger macro replacement, $ alone is not enough.

          People

            Unassigned Unassigned
            timor_raiman Timor Raiman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: