Sunday, December 30, 2012

CTR: resolving dependencies in Groovy with Grapes

+Mark Fortner commented on Google+ that my script was missing a @Grab statement. I had seen that mentioned before, but never looked at it. It turns out the be very useful, and it makes Groovy scripts standalone. That is, it will resolve the missing dependencies, using Maven repositories. Fortunately, CDK modules are available from repositories, e.g. the one at Plovdiv University, and I gave it a try. My first attempt went bad, but +Nina Jeliazkova explained me what Maven mistake I was making, and now I got a working setup:

    module='cdk-io', version='1.4.11'
    module='cdk-silent', version='1.4.11' 

So, depending on the exact script, something like the above will remove any need of setting CLASSPATHs. The above Groovy code is for counting heavy atoms.


  1. Nice, I've got a nightly (1.5.2-SNAPSHOT) maven build of master on the EBI snapshots repo which might be of use. I've swapped out some of the dependencies for more up to date ones (i.e. jena-rdf and jniinchi 0.8) but I've been using it without any issues for a while now.

    Snapshots Repo: (direct)

    Also reminds me I need to deploy 1.4.16 to the stables. I've got from 1.4.6+ on:

    1. Oh, very nice! I think your mentioned that before and I should have remembered. Can you please add it to this wiki page?