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

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

问题描述

我正在尝试在 Linux 系统上的 Grails 项目中引用 IntelliJ IDEA 9.0.2 中的一个类.我将依赖项添加到 BuildConfig.groovy:

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'
  }

我在 ~/.ivy2/cache 目录中看到 org.apache.poi,但在引用 jar 中的类时出现编译错误.事实上,完整的代码没有显示任何 org.apache.poi 类.所以看起来 IntelliJ 不知道这些类.

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.

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

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

推荐答案

想通了...工具-->同步 Grails 依赖项"

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

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

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

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

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

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

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