Grab annotation not working in editor

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Grab annotation not working in editor

annihilate@gmail.com
I have just downloaded the latest stable release of the groovy eclipse plugin for Eclipse 3.6.2 frm the update site: http://dist.springsource.org/release/GRECLIPSE/e3.6/

I then created a new groovy project, and then created a new file called test.groovy in the src folder.

In this file is the following:

@Grab(group='commons-lang', module='commons-lang', version='2.4')
import org.apache.commons.lang.WordUtils
println "Hello ${WordUtils.capitalize('world')}"

This runs fine when doing Run As -> Groovy Script

However, the content assist is not working and it shows an error in the editor: Groovy:unable to resolve class org.apache.commons.lang.WordUtils

Is there something I am doing wrong to get the @Grab annotation to actually work in the editor?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Grab annotation not working in editor

Andy Clement
You aren't doing anything wrong,  @Grab'd things don't work so well in
the editor.

This bug discusses it to a degree:
http://jira.codehaus.org/browse/GRECLIPSE-1052

I haven't looked at it recently but I'd hope that issues are just in
the editor (i.e. don't appear in the problems view) and the file will
actually RunAs>JavaApplication in addition to RunAs>GroovyScript,
which indicates the real compilation is actually fine.

cheers
Andy

On 26 May 2011 13:23, [hidden email] <[hidden email]> wrote:

> I have just downloaded the latest stable release of the groovy eclipse
> plugin for Eclipse 3.6.2 frm the update site:
> http://dist.springsource.org/release/GRECLIPSE/e3.6/
>
> I then created a new groovy project, and then created a new file called
> test.groovy in the src folder.
>
> In this file is the following:
>
> @Grab(group='commons-lang', module='commons-lang', version='2.4')
> import org.apache.commons.lang.WordUtils
> println "Hello ${WordUtils.capitalize('world')}"
>
> This runs fine when doing Run As -> Groovy Script
>
> However, the content assist is not working and it shows an error in the
> editor: Groovy:unable to resolve class org.apache.commons.lang.WordUtils
>
> Is there something I am doing wrong to get the @Grab annotation to actually
> work in the editor?
>
> Thanks
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email