IntelliJ IDEA Grails没有看到Jar [英] IntelliJ IDEA Grails Not Seeing Jar

查看:128
本文介绍了IntelliJ IDEA Grails没有看到Jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Linux系统上的Grails项目中引用IntelliJ IDEA 9.0.2中的类。我将依赖关系添加到 BuildConfig.groovy
$ b

  dependencies {
//在构建,编译,运行时,测试或提供的范围下指定依赖关系。
$ b $ runtime'mysql:mysql-connector-java:5.1.5'
compile'org.apache.poi:poi-ooxml:3.6'
}

我在<$ c中看到 org.apache.poi $ c>〜/ .ivy2 / cache 目录,但在引用jar中的类时会出现编译错误。实际上,代码完整不会显示任何 org.apache.poi 类。所以看来IntelliJ不知道这些类。



任何想法我做错了?为什么IntelliJ看不到这些类?

解决方案

想出来......工具 - >同步Grails依赖关系 / p>

在IntelliJ 13.1中,现在是:工具 - > Grails - >同步Grails



在IntelliJ 15中, 同步选项已移至文件 - >同步

I'm trying to reference a class within IntelliJ IDEA 9.0.2 in a Grails project on a Linux system. I added the dependency to BuildConfig.groovy:

dependencies {
    // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.

    runtime 'mysql:mysql-connector-java:5.1.5'
    compile 'org.apache.poi:poi-ooxml:3.6'
  }

I see the org.apache.poi in my ~/.ivy2/cache directory, but get a compile error when referencing a class in the jars. In fact, the code complete doesn't show any org.apache.poi classes. So it appears IntelliJ doesn't know about these classes.

Any ideas what I'm doing wrong? Why doesn't IntelliJ see these classes?

解决方案

Figured it out... "Tools-->Synchronize Grails dependencies"

In IntelliJ 13.1, it is now: Tools -> Grails -> Synchronize Grails

In IntelliJ 15, the "Synchronize" option moved to File -> Synchronize

这篇关于IntelliJ IDEA Grails没有看到Jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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