Groovy Grapes in NetBeans IDE
Posted
by Geertjan
on Oracle Blogs
See other posts from Oracle Blogs
or by Geertjan
Published on Mon, 4 Nov 2013 08:10:31 +0000
Indexed on
2013/11/04
10:08 UTC
Read the original article
Hit count: 252
/NetBeans IDE
The start of Groovy Grapes support in NetBeans IDE. Below you see a pure Groovy project, with the Groovy JAR and the Ivy JAR automatically on its classpath. There's also a Groovy script that makes use of a @Grab annotation. In the bottom left, in the Services window, you also see a Grape Repository browser, i.e., showing you the JARs that are currently in ".groovy/grapes". Click the images below to get a better look at them.
Next, you see what happens when the project is run. The @Grab annotation automatically starts downloading the JARs that are needed and puts them into the ".groovy/grapes" folder. However, the "no suitable classloader found for grab" error message (which Google shows is a problem for lots of developers) prevents the application from running successfully:
The final screenshot shows that I've put the JARs that I need onto the classpath of the project. I did that manually, hoping to learn from the NetBeans Maven project or the NetBeans Gradle project how to do that automatically. Also note that the @Grab annotation has been commented out. Now the error message about the classloader is avoided and the project runs.
What needs to happen for Groovy Grapes support to be complete in NetBeans IDE:
- Figure out how to add the downloaded JARs to the project classpath automatically.
- Fix the refresh problem in the Grape Repository browser, i.e., right now the refresh doesn't happen automatically yet.
- Hopefully find a way to get around the grab classloader problem, i.e., it's not ideal that one needs to comment out the annotation.
- Let the user specify a different Grape repository, i.e., right now ".groovy/grapes" is assumed, but the user should be able to point the repository browser to something different. Maybe there should be support for multiple Grape repositories?
Comments/feedback/help is welcome.
© Oracle Blogs or respective owner