I have a groovy script I am working on, which imports dependencies using the @Grab annotation. This script will run within IDEA, and from the command line. However, within the IDE, the imports are shown in red (as unresolvable), and no auto-completion on the classes so imported is given.
I am accessing a corporate repository via a proxy, which has been configured as the Http Proxy within IDEA (the module should be, and is, in my local .m2 repo anyway!)
Anyone got any ideas (no pun intended!)?
I am using IntelliJ IDEA 12.5 Ultimate (IU-129.1135), JRE 1.7, and Groovy 2.1.6
In the Project tool window, right-click the project and from the context menu, select Add Framework Support. In the dialog that opens, select Groovy and click OK. IntelliJ IDEA adds the Groovy SDK to your project and you can add Groovy classes and Groovy scripts.
Groovy The Groovy plugin is bundled with IntelliJ IDEA and enabled by default. IntelliJ IDEA supports the latest stable version of Groovy and Groovy 4 syntax.
Add Groovy script IntelliJ IDEA opens the file in the editor. Type the following code: println("Hello, Groovy!") Press Ctrl+Shift+F10 to run the script.
As stated by CrazyCoder, Alt
+ Enter
then select Grab the artifacts and Enter
There could be 2 problems interfering with the resolution of the Grab dependencies
"Mark Directory As" -> "Sources Root"
"Project" -> "Project SDK"
and give it a Java JDK.Once these steps are done, you should be able to hit Alt
+ Enter
and then select "Grab the artifacts"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With