updated to 2019.1 and groovy cannot find symbol

已回答

Hi,

I just upgraded to 2019.1.

I have 3 modules in my project, 2 of which are Java Maven based.

Each project is built and deployed via maven from git on Jenkins and has a Jenkinsfile with groovy. All 3 modules have groovy scripts which start with the annotation "@Library('aes4.1.5')"

After upgrading, IntelliJ is now flagging the first lines in these scripts with the error "Cannot resolve symbol 'Library'"

In the project structure, there's no groovy setting anymore, and in the Settings/Groovy Compiler Settings, there's no "path to configscript", although I don't think there ever was.

How do I tell IntelliJ not to worry about this now?

1
Avatar
Permanently deleted user

I have the bundled Plugin for Groovy language support, including, Grape and Gant

1

Please make sure that Groovy plugin is enabled and up to date.

0
Avatar
Permanently deleted user

So theoretically, my groovy scripts should be fine with no 'cannot find symbol', right?

0

Nothing has actually changed in the resolve in 2019.1. But now all unresolved class symbols are highlighted with errors because Groovy compiler will also fail. So it seems that Groovy knows about this @Library while IntelliJ doesn't. Where does that Library comes from?

You may also try and verify this in 2018.3, if you try to navigate to Library, then 'Cannot find declaration to go' tooltip should appear.

0
Avatar
Permanently deleted user

I see 'Cannot find declaration to go to' with all classes, in 2018.3 as well as now, even with classes that are defined in scripts in the same project but just in different script files.

Basically Jenkins will run the script file when it executes a build job, loading all sort of libraries in an environment that I can't recreate locally without a massive effort.

Can I just turn off the Groovy class error highlighting then?

Thanks

0

You cannot at the moment.

I'll disable highlighting for files outside of source roots.

0
Avatar
Permanently deleted user

OK, sounds good. Thanks.

0

帖子评论已关闭。