Cannot use java.util.regex.Matcher class when workflow script is sandboxed

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Using this in a workflow script

      def fileText = readFile('dist/index.html')
      fileText = (fileText =~ /baseUrl.('.')/).replaceFirst("baseUrl: 'XXXX'")

      throws this:

      org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method java.util.regex.Matcher replaceFirst java.lang.String

            Assignee:
            Jesse Glick
            Reporter:
            Dominik Bartholdi
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: