Groovy和IntelliJ - 编译代码 [英] Groovy and IntelliJ - getting code compiled

查看:81
本文介绍了Groovy和IntelliJ - 编译代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在intelliJ中,我可以看到A类的一些导入了一些项目groovy代码,并且我还包含了具有该代码的库。



然而,虽然包本身是一种颜色(用于导入),但实际的类导入是红色的,这意味着某种问题。



当我运行一个make或者重建项目时,问题就开始了 - 我得到了

  Groovyc:无法解析类com.blah.blah.blah.A 

如何解决这个问题?



目前,我的项目设置如下所示:



在(项目结构 - >项目设置 - >库)的库下,我有:

jar文件包含所有常规代码
包含所有groovy代码的src jar文件

在Modules部分中,我有 - 呃,我不知道该怎么称呼它,该列未标记 - 与src和class文件关联的库部分的库名称以及旁边的小导出按钮被打勾。



顺便说一句,在intelliJ中打开类永远不会显示源代码,它包含了源代码,令我感到奇怪。



有没有什么否则我应该这样做?

我已经完成了这一项,但如果有人知道为什么groovy不能在资源模式列表,并希望得到一个赞成票,做手势

解决方案

b

我在 File:Settings - 中删除了项目列表中的!?*。groovy >编译器 - >资源模式 thingy。



开启或关闭使用外部构建似乎并不重要为此,但!?*。groovy ;入口不能在那里。



不知有人知道为什么吗?


I have IntelliJ 12 and some groovy code (along with a pile of java code) in a project.

In intelliJ, i can see class A's import of some groovy code, and i have also included the library that has that code.

However, while the package itself is in one colour (for the import), the actual class being imported is in red, which implies an issue of some sort. Hovering the mouse over it reveals no issue though.

When i run a "make" or a "rebuild project" is where the problems start - i get

Groovyc: unable to resolve class com.blah.blah.blah.A

How can i resolve this?

Currently, my project setup is like so:

Under "Libraries" in (Project Structure -> Project Settings -> Libraries) I have:

the jar file with all the groovy code the src jar file with all the groovy code

In the "Modules" section i have the - well, i don't know what to call it, the column isn't labelled - the library name from the libraries section associated with the src and class files, and the little "export" button beside it is ticked.

Incidentally, opening the class in intelliJ never shows the source code, which given the source is included struck me as weird.

Is there anything else I should need to do?

I've worked this one out, but if anybody knows why groovy cannot be in the "Resource Patterns" list and wants an upvote, do chime in

解决方案

Oh, right.

I removed the !?*.groovy entry from the list of, um, entries in the File : Settings -> Compiler -> Resource Patterns thingy.

It doesn't seem to matter if "use external build" is on or off for this, but the !?*.groovy; entry cannot be there.

I wonder if anybody knows why?

这篇关于Groovy和IntelliJ - 编译代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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