title: Groovy: How does @Grab inclusion differ from classpath inclusion?
body: <h3>1. Generally, how is @Grape/@Grab inclusion different than classpath inclusion?</h3>
  
  <h3>2. Specifically, what might cause the following behavior difference?</h3>
  
  <p>I've got a requirement on <code>xpp3</code> which I express as:</p>
  
  <pre><code>// TestScript.groovy
  @Grab(group='xpp3', module='xpp3', version='1.1.3.4.O')
  import org.xmlpull.v1.XmlPullParserFactory;
  println "Created: " + XmlPullParserFactory.newInstance()
  </code></pre>
  
  <p>Running <code>$ groovy TestScript.groovy</code> fails with</p>
  
  <blockquote>
    <p>Caught: org.xmlpull.v1.XmlPullParserException: caused by: org.xmlpull.v1.XmlPullParserException:</p>
  </blockquote>
  
  <p>If, however, I <strong>manually add the .jar fetched by Grape to my Groovy classpath</strong>:</p>
  
  <pre><code>$ groovy -cp ~/.groovy/grapes/xpp3/xpp3/jars/xpp3-1.1.3.4.O.jar \
           TestScript.groovy 
  </code></pre>
  
  <p>... then everything works.</p>