Strange variable scoping behavior in Jenkinsfile

TL;DR variables defined with def in the main script body cannot be accessed from other methods. variables defined without def can be accessed directly by any method even from different scripts. It’s a bad practice. variables defined with def and @Field annotation can be accessed directly from methods defined in the same script. Explanation When … Read more

Groovy Shell warning “Could not open/create prefs root node …”

Dennis answer is correct. However I would like to explain the solution in a bit more detailed way (for Windows User): Go into your Start Menu and type regedit into the search field. Navigate to path HKEY_LOCAL_MACHINE\Software\JavaSoft (Windows 10 seems to now have this here: HKEY_LOCAL_MACHINE\Software\WOW6432Node\JavaSoft) Right click on the JavaSoft folder and click on … Read more