Results 1 to 5 of 5

Thread: Grape

Hybrid View

  1. #1

    Question Grape

    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

  2. #2
    Join Date
    May 2009
    Location
    Vancouver
    Posts
    274

    Default

    Hi,

    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 .

    cheers
    Andy
    ---
    Andy Clement
    SpringSource Tool Suite Team

  3. #3

    Default

    Quote Originally Posted by Andy Clement View Post
    Hi,

    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.

    ...
    OK. That helps! In the short run, I just mavenized the project and threw a POM in there.

    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?

  4. #4
    Join Date
    May 2009
    Location
    Vancouver
    Posts
    274

    Default

    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.

    Andy

  5. #5

    Smile

    Great! Thanks!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •