Grails 2.3.10
我已经创作了一个Grails插件,可以在我公司内部使用并安装在公司的Artifactory仓库中。如何设置另一个项目的BuildConfig,以便在安装插件时检查公司的私有神器仓库?
以下是我的尝试:
repositories {
...
grailsRepo "http://artifactory.mycompany.com/"
}
还有...
repositories {
...
mavenRepo "http://artifactory.mycompany.com/"
}
这些似乎都没有任何效果。什么是更改或添加到grails插件repo的正确配置?
理想情况下,我希望检查自定义repo和grails central repo的插件。
修改
进一步澄清......我希望我的项目配置为下拉一个仅存在于公司的神器服务器上的插件,而不是中央的Grails插件存储库。
我从grails compile获得以下输出:
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)
看起来公司服务器没有根据构建输出进行访问。
答案 0 :(得分: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/")
}
然后将插件打包为:
grails publish-plugin --allow-overwrite --noScm --repository=localPluginReleases
应用程序的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
}
}