首页 > 解决方案 > 即使有插件,从 Grails 插件存储库下载也会失败

问题描述

我正在尝试将remote-control插件与 Grails 2.5.6 一起使用。根据文档,我将以下内容添加到BuildConfig.groovy

repositories {
    ...
    mavenRepo "http://dl.bintray.com/alkemist/maven/"
}

dependencies {
    ...
    compile "org.grails.plugins:remote-control:2.0"
}

plugins {
    test ":remote-control:2.0"
}

现在,输出grails refresh-dependencies是:

| Loading Grails 2.5.6
| Configuring classpath
| Downloading: org/grails/plugins/remote-control/2.0/remote-control-2.0.pom
| Downloading: io/remotecontrol/remote-core/0.7/remote-core-0.7.pom
| Downloading: io/remotecontrol/remote-transport-http/0.7/remote-transport-http-0.7.pom
| Downloading: org/grails/plugins/remote-control/2.0/remote-control-2.0.zip
| Downloading: io/remotecontrol/remote-transport-http/0.7/remote-transport-http-0.7.jar
| Downloading: io/remotecontrol/remote-core/0.7/remote-core-0.7.jar
| Error Resolve error obtaining dependencies: Could not find artifact org.grails.plugins:remote-control:jar:2.0 in grailsCentral (https://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
| Error Resolve error obtaining dependencies: Could not find artifact org.grails.plugins:remote-control:jar:2.0 in grailsCentral (https://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
| Error Resolve error obtaining dependencies: Could not find artifact org.grails.plugins:remote-control:jar:2.0 in grailsCentral (https://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
| Error Could not find artifact org.grails.plugins:remote-control:jar:2.0 in grailsCentral (https://repo.grails.org/grails/plugins)

为了强调,我们得到

在 grailsCentral ( https://repo.grails.org/grails/plugins )中找不到工件 org.grails.plugins:remote-control:jar:2.0

令人困惑的部分是插件似乎正是它应该在的地方:

在此处输入图像描述

我觉得我错过了一些明显的东西——它是什么?

标签: mavengrailsgrails-plugin

解决方案


该文档以另一种方式过时:添加依赖项不是必需的,实际上确实会导致问题中的解析错误(我发现插件源,而不是可用作代码依赖项的 JAR)。

删除后

compile "org.grails.plugins:remote-control:2.0"

dependencies,Grails 正确刷新依赖项并使用插件运行。


推荐阅读