I am starting to develop some scripts in Groovy which requires some Maven dependencies. I have a new project, with a Java module, with Groovy support enabled (1.8.6, installed from repos for Ubuntu as described here), and then created this script:
@Grab(group='com.unboundid', module='unboundid-ldapsdk', version='2.3.0')
LDAPConnection ldapConnection = new LDAPConnection();
As I have annotated the "import" with a "Grab", I suppose to Groovy automatically download that dependency from Maven; if I run the script from the console, the script works fine, but IDEA doesn't recognise the annotation, as the editor always says "Cannot resolve symbol 'unboundid'" in the import statement, and "Cannot resolve symbol 'LDAPConnection'", and so the code completion does not work. What should be the correct behaviour of IDEA? Should it download the dependencies and import them to the project?
Thanks in advance.