Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

step cancelled due to groovy MultipleCompilationErrorsException #3953

OnQuickBuild ·

Hello Robin

I'm facing a weird issue where a step is cancelled due to the following groovy error:

failed: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: 
script1528314509681170623410.groovy: 2: unexpected token: def @ line 2, column 1. 
def package = system-2018.3.1-debug_proto 
^ 
1 error 

    at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302) 
    at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:149) 
    at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:119) 
    at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:131) 
    at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:359) 
    at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:142) 
    at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:108) 
    at org.codehaus.groovy.control.SourceU...

In the step Execute Condition, I use "if specified script evaluates to true", and this is the script

groovy:
def package = ${params.get('release_name')}
if (package.contains('int_test') == false)
  return true
return false

Is there some restriction I broke here using groovy?

Thanks!

  • solved #3
  • replies 3
  • views 1677
  • stars 0
OnQuickBuild ·

I did a different way, using a standalone "execute script" step to change some value based on params, instead of inside "execute condition of a step".
And it still reports the same issue:

failed: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: 
script15283193100311723358036.groovy: 2: unexpected token: def @ line 2, column 1. 
def package = params.get('release_name') 
^ 

1 error 

    at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302) 
    at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:149) 
    at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:119) 
    at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:131) 
    at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:359) 
    at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:142) 
    at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:108) 
    at org.codehaus.groovy.control.SourceUnit.parse(...
robinshen ADMIN ·

Could it be that "package" is a reserved keyword in groovy?

OnQuickBuild ·

And it really is. This is embarrassing.

Thanks!