IntelliJ IDEA Grails Not Seeing Jar

2019-02-17 13:35发布

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?

2条回答
冷血范
2楼-- · 2019-02-17 14:05

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

查看更多
成全新的幸福
3楼-- · 2019-02-17 14:17

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

查看更多
登录 后发表回答