如何在IDE中使用Grails依赖关系 [英] How to make use of Grails Dependencies in your IDE

查看:256
本文介绍了如何在IDE中使用Grails依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我终于得到了我的依赖与Grails合作。现在,我的IDE(例如IntelliJ或Eclipse)如何能够利用它?或者我真的必须在开发时间手动管理我的IDE知道的类



如果 BuildConfig.groovy 脚本设置正确(请参阅此处) ,你可以用vi或你最喜欢的编辑器代码解决问题,然后运行 grails compile ,这将解析并下载依赖到常青藤缓存离开你 ...



但是,如果您使用的是Eclipse或IntelliJ等IDE,那么在编码时您需要依赖。显然 - 这些动物会需要它们来进行实时错误检测/编译过程。



现在,尽管当然可以代码中所有的类都以鲜亮的红色闪耀在IDE所不知道的地方,这当然是 ...

...

Maven支持或任何正式称为pom文件的生活愉快,至少在IntelliJ中不需要额外的jar目录指针。 我希望能够对Grails依赖关系进行相同处理



目前我正在 BuildConfig.groovy 中定义它们,另外我将当前的jar复制/粘贴到我的本地磁盘并让IDE指向它。



不太令人满意,因为我在代码更改方面处于高度不稳定的项目模块环境中。而这种情况直接导致我进入jar地狱,因为我的开发和构建依赖项很容易失去同步,我必须手动管理,即用我的大脑......



我的大脑应该忙于其他内容 ...

谢谢!
Raoul

P.S:我目前使用的是Grails 1.2M4和IntelliJ 92.105。但可随时在未来版本的Grails和不同的未来IDE中添加答案,如 ...

...

解决方案<如果你有Eclipse和Grails插件,只需运行:
Grails工具 - >刷新依赖关系
(实际上我已经用STS试过了)。


So I finally got my dependencies working with Grails. Now, how can my IDE, eg IntelliJ or Eclipse, take advantage of it? Or do I really have to manually manage what classes my IDE knows about at "development time"?

If the BuildConfig.groovy script is setup right (see here), you will be able to code away with vi or your favorite editor without any troubles, then run grails compile which will resolve and download the dependencies into the Ivy cache and off you go...

If, however, you are using an IDE like Eclipse or IntelliJ, you will need the dependencies at hand while coding. Obviously - as these animals will need them for the "real time" error detection/compilation process.

Now, while it is certainly possible to code with all the classes shining up in bright red all over the place that are unknown to your IDE, it is certainly not much fun...

The Maven support or whatever it is officially called lives happily with the pom file, no extra "jar directory" pointers needed, at least in IntelliJ. I would like to be able to do the same with Grails dependencies.

Currently I am defining them in the BuildConfig.groovy and additionally I copy/paste the current jars around on my local disk and let the IDE point to it.

Not very satisfactory, as I am working in a highly volatile project module environment with respect to code change. And this situation ports me directly into "jar hell", as my "develop- and build-dependencies" easily get out of sync and I have to manage manually, that is, with my brain...

And my brain should be busy with other stuff...

Thanks! Raoul

P.S: I'm currently using Grails 1.2M4 and IntelliJ 92.105. But feel free to add answers on future versions of Grails and different, future IDEs, as the come in...

解决方案

If you have Eclipse with Grails plugin just run: Grails Tools->Refresh Dependencies (actually I have tried this with STS).

这篇关于如何在IDE中使用Grails依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆