我正在使用 GRails 2.4.3
每当我尝试安装 Grails MongoDB 插件时http://grails.org/plugin/mongodb我收到此错误:
|Configuring classpath
|Downloading: org/grails/grails-datastore-gorm-plugin-support/3.1.0.RELEASE/grails-datastore-gorm-plugin-support-3.1.0.RELEASE.pom
|Downloading: org/grails/grails-spring/2.3.8/grails-spring-2.3.8.pom
|Downloading: org/grails/grails-datastore-web/3.1.0.RELEASE/grails-datastore-web-3.1.0.RELEASE.pom
Error |
Resolve error obtaining dependencies: Failed to read artifact descriptor for org.grails:grails-datastore-gorm-plugin-support:jar:3.1.3.BUILD-SNAPSHOT (Use --stacktrace to see the full trace)
Error |
Resolve error obtaining dependencies: Failed to read artifact descriptor for org.grails:grails-datastore-gorm-plugin-support:jar:3.1.3.BUILD-SNAPSHOT (Use --stacktrace to see the full trace)
Error |
Resolve error obtaining dependencies: Failed to read artifact descriptor for org.grails:grails-datastore-gorm-plugin-support:jar:3.1.3.BUILD-SNAPSHOT (Use --stacktrace to see the full trace)
Error |
Resolve error obtaining dependencies: Failed to read artifact descriptor for org.grails:grails-datastore-gorm-plugin-support:jar:3.1.3.BUILD-SNAPSHOT (Use --stacktrace to see the full trace)
Error |
Failed to read artifact descriptor for org.grails:grails-datastore-gorm-plugin-support:jar:3.1.3.BUILD-SNAPSHOT
|Run 'grails dependency-report' for further information.
IDEA hook: Grails not found!
Error |
java.lang.NullPointerException
Error |
at org.jetbrains.groovy.grails.rt.Agent$2.run(Agent.java:135)
Error |
at java.lang.Thread.run(Thread.java:744)
这些是我的构建配置设置:
dependencies{
...
compile 'org.grails:grails-datastore-gorm-plugin-support:3.1.0.RELEASE'
}
plugins{
..
compile ':mongodb:3.0.2'
}
即使我添加
compile 'org.grails:grails-datastore-gorm:latest.release'
compile 'org.grails:grails-datastore-core:latest.release'
test 'org.grails:grails-datastore-simple:latest.release'
对于插件页面中提到的依赖项(因为我使用的是 Grails 2.4,所以我不应该这样做),我得到了同样的错误。
另外要补充的是,这个插件已经有几个月没有对我有用了,但我在网上还没有看到其他人遇到这个问题。我是唯一经历过这种事的人吗?
我该如何安装这个插件?
谢谢。
我不知道为什么 3.0.2 具有这些依赖项,并且 3.0.2 是否可以使用,但如果您想让它正常工作,那么您需要排除 SNAPSHOT 依赖项并使用 RELEASE 版本。
plugins {
compile (":mongodb:3.0.2") {
excludes 'grails-datastore-gorm-plugin-support'
excludes 'grails-datastore-gorm'
excludes 'grails-datastore-core'
}
}
然后在依赖项中,将正确的项拉入:
dependencies {
compile 'org.grails:grails-datastore-gorm-plugin-support:3.1.3.RELEASE'
compile 'org.grails:grails-datastore-gorm:3.1.3.RELEASE'
compile 'org.grails:grails-datastore-core:3.1.3.RELEASE'
}
Edit:实际上,仔细检查 3.0.2 pom,依赖关系应该是 3.1.2.RELEASE,因此使用 3.1.3 的事实意味着发生了一些奇怪的事情。我清理了 ~/.m2 目录,“grails dependency-report”现在显示了正确的 3.1.2.RELEASE 依赖项。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)