IntelliJ IDEA not resolving grails dependencies
Hi
I am using IntelliJ IDEA 11.1.4, Build #IU-117.963. The dependencies included in BuildConfig.groovy is not resolved by the IDE. For example I have the following in BuildConfig.groovy
plugins {
build(":tomcat:$grailsVersion",
":release:2.0.4") { export = false }
compile(":spring-security-core:1.2.7.3") { export = false }
}
and I import the following in my controller,
import org.springframework.security.authentication.AccountExpiredException
I see an error "Cannot resolve symbol "authentication" in the editor. The application seems to run fine, but the editor shows the error. I have tried doing "Synchronize Grails Settings" many times. That doesnt seem to solve the problem.
How can I get the IDE to resolve the dependencies?
Thanks
Anand
请先登录再写评论。
Please, attach the output from Grails Console after running "Synchronize Grails Settings"
Attached...
Anand
Attachment(s):
grails_sync_settings.zip
Did you have this problem with previous IDEA (older than 11.1.4)?
Grails working directory is set to "../../../../../.grails" (see line "grails.work.dir=../../../../../.grails" in attached console output). Please, attach the pease of BuildConfig.groovy where you override grails.work.dir
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.target.level = 1.6
grails.work.dir = "../../../../../.grails"
// For debugging only. Comment out before check-in
cacheDir "../../../../../.ivy2.cache/main"
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
// log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
log "warn"
// Whether to verify checksums on resolve
checksums true
repositories {
....
// grails repositories....
// local ivy repository....
}
dependencies { // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
compile "com.jayway.jsonpath:json-path:0.8.1"
}
plugins {
build(":tomcat:$grailsVersion",
":release:2.0.4") { export = false }
compile(":spring-security-core:1.2.7.3") { export = false }
}
}
One more thing... The module is a grails plugin module. I have one project which contains three modules - 1 grails application module and 2 grails plugin modules.
There was a bug: IDEA incorrectly Synchronizes Grails Settings if ivy cacheDir is relative path like "../../../../.ivy2.cacheTttt/main".
I've fixed it. Fix will be available in IDEA 12.
Thanks for bug reporting.
Sergey,
Thanks for the fix. For now I am using the full path and that seems to have solved my problem. When can we expect IDEA 12 to be released. I really need to use relative path.
Thanks
Anand