Skip to content

Instantly share code, notes, and snippets.

Created December 9, 2016 00:10
Show Gist options
  • Save rtyler/e5e57f075af381fce4ed3ae57aa1f0c2 to your computer and use it in GitHub Desktop.
Save rtyler/e5e57f075af381fce4ed3ae57aa1f0c2 to your computer and use it in GitHub Desktop.
Example of an invalid casing for a Global Variable in a Pipeline Shared Library
Started by user rtyler
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 2: unexpected token: Mr Jenkins @ line 2, column 14.
SayHello "Mr Jenkins"
1 error
at org.codehaus.groovy.control.ErrorCollector.failIfErrors(
at org.codehaus.groovy.control.ErrorCollector.addFatalError(
at org.codehaus.groovy.control.ErrorCollector.addError(
at org.codehaus.groovy.control.ErrorCollector.addError(
at org.codehaus.groovy.control.SourceUnit.addError(
at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(
at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(
at org.codehaus.groovy.control.SourceUnit.parse(
at org.codehaus.groovy.control.CompilationUnit$
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(
at org.codehaus.groovy.control.CompilationUnit.compile(
at groovy.lang.GroovyClassLoader.doParseClass(
at groovy.lang.GroovyClassLoader.parseClass(
at groovy.lang.GroovyShell.parseClass(
at groovy.lang.GroovyShell.parse(
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(
at hudson.model.ResourceController.execute(
Finished: FAILURE
node {
SayHello "Mr Jenkins"
#!/usr/bin/env groovy
def call(name) {
echo "Hello the ${name}"
Copy link

I get this same error but my casing is correct. Is there a good way to troubleshoot this?

Copy link

@mhedgpeth did you get an answer to this?

Copy link

The variable name should be sayHello or similar, per the docs:

Copy link

Screenshot from 2022-09-20 17-22-48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment