Posts

Showing posts with the label jenkins-pipeline

Groovy : Constructor call must be the first statement in a constructor

Image
Clash Royale CLAN TAG #URR8PPP Groovy : Constructor call must be the first statement in a constructor New to Groovy. Using scripts as part of Jenkins pipeline. Editing in Sublime with only a linter. Receiving this error: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: file:/var/jenkins_home/jobs/{repo}/branches/master/builds/9/libs/{jenkins-library-name}/src/{srcPath}/Pom_EX.groovy: 12: Constructor call must be the first statement in a constructor. at line: 12 column: 11. 1 Answer 1 Really beat myself up here for taking so long to see it. I didn't see it, since I've been working in Java for a few years now - and the IDE points out this type of mistake. Name of the constructor didn't match the class.... I reproduced the problem with a dummy class. Running DUMMY d = new DUMMY('blah') produced : DUMMY d = new DUMMY('blah') 1 compilation...