Darshan Hirannadani : How can I use Grape to manage dependencies in a Groovy project?

Hi Team,

I’m Darshan Hiranandani, new to OpenHAB and have experience with Jenkins and Groovy. I’m trying to use Grape to include dependencies in my Groovy rules, but I’m encountering issues due to a missing Ivy setup. I have a couple of questions:

  1. Using Grape with OpenHAB: Can Grape be used to manage dependencies in Groovy scripts within OpenHAB? If so, how can I resolve issues related to missing Ivy?
  2. Class Loading in Rules: How does class loading work for Groovy rules in OpenHAB? Is it specific to each rule, or is there a different mechanism in place?
  3. Alternative Methods: If Grape isn’t feasible in this environment, are there alternative methods for managing dependencies in Groovy scripts within OpenHAB?
  4. Configuration Tips: What are the best practices for integrating external libraries or dependencies in OpenHAB Groovy rules?

Any insights or suggestions on these points would be greatly appreciated!

Thanks,

Darshan Hiranandani

There aren’t many Groovy users, but I’ve seen @wborn and @Oleg_Andreych contributing to the groovy addon.

It doesn’t work out of the box but it is possible, see: