如何从自定义神器仓库加载grails插件?

RMo*_*sey 0 grails artifactory grails-plugin

Grails 2.3.10

我已经创作了一个Grails插件,可以在我公司内部使用并安装在公司的Artifactory仓库中.如何设置另一个项目的BuildConfig,以便在安装插件时检查公司的私有神器仓库?

这是我尝试过的:

repositories {
    ...
    grailsRepo "http://artifactory.mycompany.com/"
}
Run Code Online (Sandbox Code Playgroud)

并且...

repositories {
    ...
    mavenRepo "http://artifactory.mycompany.com/"
}
Run Code Online (Sandbox Code Playgroud)

这些似乎都没有任何影响.更改或添加到grails插件仓库的正确配置是什么?

理想情况下,我希望检查自定义repo和grails central repo的插件.

编辑:

为了进一步澄清......我希望我的项目配置为下拉一个只存在于公司的神器服务器上的插件,而不是中心的Grails插件仓库.

我从grails编译得到以下输出:

Error |
Resolve error obtaining dependencies: Could not find artifact org.grails.plugins:cascade-validation:zip:0.1.0 in grailsCentral (http://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
Error |
Resolve error obtaining dependencies: Could not find artifact org.grails.plugins:cascade-validation:zip:0.1.0 in grailsCentral (http://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
Error |
Resolve error obtaining dependencies: Could not find artifact org.grails.plugins:cascade-validation:zip:0.1.0 in grailsCentral (http://repo.grails.org/grails/plugins) (Use --stacktrace to see the full trace)
Error |
Could not find artifact org.grails.plugins:cascade-validation:zip:0.1.0 in grailsCentral (http://repo.grails.org/grails/plugins)
Run Code Online (Sandbox Code Playgroud)

看起来公司服务器没有基于构建输出进行访问.

Ken*_*Ken 5

这是我如何做到的.该插件的BuildConfig.groovy:

grails.project.dependency.distribution = {
    remoteRepository(id: "localPluginReleases", url: "http://localhost:8081/artifactory/plugins-release-local/")
    remoteRepository(id: "localPluginSnapshots", url: "http://localhost:8081/artifactory/plugins-snapshot-local/")
}
Run Code Online (Sandbox Code Playgroud)

然后将插件打包为:

grails publish-plugin --allow-overwrite --noScm --repository=localPluginReleases
Run Code Online (Sandbox Code Playgroud)

该应用程序的BuildConfig.groovy:

grails.project.dependency.resolution = {
    repositories {
        mavenRepo "http://localhost:8081/artifactory/plugins-snapshot-local/"
        mavenRepo "http://localhost:8081/artifactory/plugins-release-local/"
        //  other stuff
    }
}
Run Code Online (Sandbox Code Playgroud)