简体   繁体   English

IntelliJ IDEA/Grails 无法解析插件

[英]IntelliJ IDEA/ Grails not resolving plugins

I have been using IntelliJ for almost a year ad I have always been really happy with it.我使用 IntelliJ 已经快一年了,我一直对它非常满意。 However, yesterday I set it up on my new laptop (Ubuntu 11.04), and haven't seen the plugins module since.. :-(但是,昨天我在我的新笔记本电脑(Ubuntu 11.04)上设置了它,从那以后就没有看到插件模块了.. :-(

Ran grails clean , tried to change the project structure/settings to include $HOME/.grails/1.3.x/projects/projectName/plugins , but still nothing. Ran grails clean ,尝试更改项目结构/设置以包括$HOME/.grails/1.3.x/projects/projectName/plugins ,但仍然没有。 My understanding is that it should pick up the plugins automatically, am I right?我的理解是它应该自动拾取插件,对吗?

For the record, I am using Grails 1.3.4, IntelliJ IDEA Ultimate 9.0.4.作为记录,我使用的是 Grails 1.3.4,IntelliJ IDEA Ultimate 9.0.4。

I'd strongly recommend switching to the latest Intellij version (10.5.1 as of now).我强烈建议切换到最新的 Intellij 版本(截至目前为 10.5.1)。 Support for Grails has been improved a lot since 9.x.自 9.x 以来,对 Grails 的支持得到了很大改进。 If you don't want to upgrade, check the following areas:如果您不想升级,请检查以下区域:

  • are all used classpath variables set correctly?所有使用的类路径变量是否设置正确?
  • are you referencing the correct Grails version?您是否引用了正确的 Grails 版本?

I'm using IntelliJ 11.1.3 with Grails 2.1.1.我正在使用 IntelliJ 11.1.3 和 Grails 2.1.1。

General Issue: The IDE Build/Make Project/Run Unit-tests sometimes fails to resolve classes referenced as dependencies within Plugins and produces 'no class...' errors.一般问题:IDE 构建/制作项目/运行单元测试有时无法解析插件中作为依赖项引用的类,并产生“无 class...”错误。 Normal grails targets (compile, run-app, test-app) work without issue!正常 grails 目标(编译、运行应用程序、测试应用程序)工作没有问题!

Workaround: Restarting IntelliJ 'magically' corrected my Plugin related 'no class...' errors.解决方法:“神奇地”重新启动 IntelliJ 更正了与插件相关的“无 class ...”错误。

What didn't work: grails resolve-dependencies (makes sense because grails run-app worked fine!) grails clean (again makes sense this is just purging the output)什么不起作用:grails resolve-dependencies(有意义,因为 grails run-app 运行良好!)

Seems like the IDE Build/Make Project/Run Unit-tests uses a stale classpath in some circumstances.似乎 IDE Build/Make Project/Run Unit-tests 在某些情况下使用过时的类路径。 Unfortunately I don't have a repeatable test case but noticed that modifying BuildConfig and doing grails refresh-dependencies or compile or run-app doesn't make the IDE update it's list of grailsPlugins!不幸的是,我没有可重复的测试用例,但注意到修改 BuildConfig 并执行 grails 刷新依赖或编译或运行应用程序不会使 IDE 更新它的 grailsPlugins 列表!

IMPORTANT UPDATE.重要更新。 It will be fixed in 11.1.2!它将在 11.1.2 中修复! YEEAAAH!耶耶!

In my case plugins not resolving because of custom system property 'grails.work.dir'.在我的情况下,由于自定义系统属性“grails.work.dir”,插件无法解析。 If your project using default 'grails.work.dir' than OK otherwise plugins won't be resolved.如果您的项目使用默认的“grails.work.dir”而不是 OK,否则插件将无法解析。 Tested on Idea 10.5.4, 11.1.1 and windows 7.在 Idea 10.5.4、11.1.1 和 windows 7 上测试。

I've had IDEA do this once in a while to me as well.我也曾让 IDEA 偶尔对我这样做。 Even in the latest version (though I do agree you should upgrade, but 9->10 isn't free).即使在最新版本中(虽然我同意你应该升级,但 9->10 不是免费的)。 For me, I just had to kill IDEA and restarted it.对我来说,我只需要杀死 IDEA 并重新启动它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM