Jan 28th, 2011, 05:47 PM
How do I get Grape to work in STS?
I have the groovy plugin; 2.1.0; 2.1.0.xx-20101020-1000-e36-release and groovy 1.7.5.xx (which came with the plugin as a dependency, right?)
My ultimate goal was to get http-builder as seen here: http://groovy.codehaus.org/modules/h.../download.html
Last edited by finneycanhelp; Jan 28th, 2011 at 06:31 PM.
Reason: getting to the core of the issue
Jan 29th, 2011, 01:28 PM
There are issues with using Grab in STS, some very simple things work, but anything more elaborate may have problems due to it wanting to mess with the classpath.
If you run the thing doing the Grab'ing as a Groovy Script, it will probably work but if you try to run it as an application, it probably won't. Code assist also breaks down with Grab'd dependencies on occasion. You will also likely see reconciling errors - errors in the editor gutter that don't appear in the problems view - those are covered by this jira http://jira.codehaus.org/browse/GRECLIPSE-411. As an example of these issues, from the page you reference I can define the snippet that creates a http builder and run it as a script, not as an app and I get a reconcile error on the def line.
When building Grab'd code, especially the first time, there are likely to be delays as jars are pulled down the background. It may look like eclipse has frozen but in fact it is because the groovy compiler gives us no indication of progress with what it is doing related to grab.
I'd recommend raising issues for any specific issues that you hit. I don't think we have one open for the 'wrong classloader found' issue that you get when running a Grab'd script as an application. Anything you do hit is probably a groovy-eclipse limitation, so I'd recommend raising it on http://jira.codehaus.org/browse/GRECLIPSE .
SpringSource Tool Suite Team
Jan 29th, 2011, 05:10 PM
OK. That helps! In the short run, I just mavenized the project and threw a POM in there.
Originally Posted by Andy Clement
Just to make sure I am on the same page as the world. Grab/Grape comes with Groovy 7+ and command line would work just fine. In general, I would not have to manually install anything for Grab/Grape to work. Things download from what is available in the maven repo and away we go. Right?
Jan 31st, 2011, 10:31 AM
No, there is nothing you manually have to install. With Groovy-Eclipse installed in Eclipse/STS you can write @Grab'ing code, and run it as a groovy script (and as it runs it will download whatever you have grabbed). But code assist will be unreliable and it won't run as a java application. Grab on the command line with just plain groovy will work just fine.
Jan 31st, 2011, 04:56 PM
Tags for this Thread