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

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

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

            jglick Jesse Glick
            domi Dominik Bartholdi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: