In my case I have closed IntelliJ, then removed rm -rf ~/.m2/repository ~/.groovy/grapes
and once Intellij is opened then Invalidated Caches with all option checked.
Then when I hover over @Grab, one light bulb will be shown. If you click on the light bulb, there is an option for "Grab the Artifacts".
@GrabResolver(name = "maven-repository", root = "https://artifacts.company.internal/artifactory/maven-all")
@Grapes([
@Grab('commons-primitives:commons-primitives:1.0'),
@Grab('org.springframework:spring-orm:5.2.8.RELEASE')
])