Intellij IDEA not importing dependencies from @Grab in Groovy project

后端 未结 2 1952
暖寄归人
暖寄归人 2021-01-31 14:35

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 I

相关标签:
2条回答
  • 2021-01-31 15:20

    There could be 2 problems interfering with the resolution of the Grab dependencies

    1. Your source code folder has not been marked as "Sources Root". To do that, right click on the folder and select "Mark Directory As" -> "Sources Root"
    2. Your project does not have a valid Project JDK. To do this, hit Ctrl-Alt-Shift-S, select "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"

    0 讨论(0)
  • 2021-01-31 15:40

    As stated by CrazyCoder, Alt + Enter then select Grab the artifacts and Enter

    0 讨论(0)
提交回复
热议问题