org.codehaus.groovy.control.MultipleCompilationErrorsException

startup failed: WorkflowScript: 30: Class definition not expected here. Please define the class at an appropriate place or perhaps try using a block/Closure instead. at line: 30 column: 2. File: WorkflowScript @ line 30, column 2. class BCadTools ^ 1 error

Solutions on the web217

  • via Google Groups by Unknown author, 11 months ago
    startup failed: WorkflowScript: 30: Class definition not expected here. Please define the class at an appropriate place or perhaps try using a block/Closure instead. at line: 30 column: 2. File: WorkflowScript @ line 30, column 2. class BCadTools ^ 1 error
  • startup failed: WorkflowScript: 23: Method definition not expected here. Please define the method at an appropriate place or perhaps try using a block/Closure instead. at line: 23 column: 5. File: WorkflowScript @ line 23, column 5. def get_current_time_date() { ^ 1 error
  • via Jenkins JIRA by Jesse Glick, 6 months ago
    startup failed: WorkflowScript: 2: Ambiguous expression could be either a parameterless closure expression or an isolated open code block; solution: Add an explicit closure parameter list, e.g. {it -> ...}, or force it to be treated as an open block by giving it a label, e.g. L:{...} @ line 2, column 1. { ^ 1 error
  • Stack trace

    • org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 30: Class definition not expected here. Please define the class at an appropriate place or perhaps try using a block/Closure instead. at line: 30 column: 2. File: WorkflowScript @ line 30, column 2. class BCadTools ^ 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:946) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:593) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688) at groovy.lang.GroovyShell.parse(GroovyShell.java:700) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:106) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:376) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:343) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:212) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    8 times, 7 months ago
    Once, 1 week ago
    Once, 1 week ago
    2 times, 2 weeks ago
    Once, 2 weeks ago
    28 more bugmates