title: Howto set up classpath for System Groovy Script in Jenkins
body: <p><a href="https://wiki.jenkins-ci.org/display/JENKINS/Groovy+plugin" rel="nofollow">Documentation for the Groovy Plugin of Jenkins</a> states that </p>
  
  <blockquote>
    <p>The system groovy script, OTOH, runs inside the Jenkins master's JVM.
    Thus it will have access to all the internal objects of Jenkins, so
    you can use this to alter the state of Jenkins. It is similar to the
    Jenkins Script Console functionality.</p>
  </blockquote>
  
  <p>Yet I find that I have a groovy script that I can successfully run in Jenkins Script Console but which does NOT run if entered as a "System Groovy Script" on a build configuration.  There are compiler errors.  Clearly, the Jenkins Script Console is running with a different classpath than the script in my build.  But I can't find information on what the default classpath is when running a script for a build or what the classpath is when running from the Script Console, so I might duplicate that for my script.</p>
  
  <p>Also, the plugin offers a classpath entry field for running the script as a file but that option does not exist for entering the script as text.  </p>
  
  <p>I can't get my script to work either way.</p>
  
  <p>What am I missing?</p>