# Error compiling a Groovy project using @Grab annotation

**URL:** <https://discuss.gradle.org/t/error-compiling-a-groovy-project-using-grab-annotation/3662>\
**Category:** Old Forum Archive\
**Created:** [August 11, 2013, 4:01pm UTC](https://discuss.gradle.org/t/error-compiling-a-groovy-project-using-grab-annotation/3662 "2013-08-11T16:01:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paolo\_Di\_Tommaso](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/paolo_di_tommaso/32/658_2.png) [@Paolo\_Di\_Tommaso](https://discuss.gradle.org/u/Paolo_Di_Tommaso)\
**Post date:** [August 11, 2013, 4:01pm UTC](https://discuss.gradle.org/t/error-compiling-a-groovy-project-using-grab-annotation/3662/1 "2013-08-11T16:01:00Z")

</div>

I’m compiling a Groovy project with Gradle, but I’ve noticed that when I use the @Grab annotation in my code, I get the following error:

```gradle
$ gradle compile
:buildInfo
:compileJava UP-TO-DATE
:compileGroovy FAILED
  FAILURE: Build failed with an exception.
  * What went wrong:
Execution failed for task ':compileGroovy'.
> org/apache/ivy/core/report/ResolveReport

```

Full stack trace here [http://pastebin.com/0ty4jNct](http://pastebin.com/0ty4jNct)

I’ve found out that the only way to get it working is to add the ‘groovy’ and ‘ivy’ module to the _groovy_ classpath, but I would like to avoid this, since the _groovy_ classpath is deprecated.

Is this a Gradle bug? or there’s a better way to manage the @Grab dependency?

Thanks, Paolo

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [August 11, 2013, 4:18pm UTC](https://discuss.gradle.org/t/error-compiling-a-groovy-project-using-grab-annotation/3662/2 "2013-08-11T16:18:00Z")

</div>

Already answered on Stack Overflow (please don’t double-post).
