我有一个Grails(2.3.6)插件(grails-myplugin
)需要我的Grails应用程序(myapp
)使用。在MyPluginPlugin.groovy
内,我有:
def version = "0.1.0"
在插件上运行package-plugin
后,我离开了grails-myplugin-0.1-0.zip
。
我有一个Artifactory服务器位于:
http://myartifactory01/artifactory
在此Artifactory实例中,有一个名为myorg-releases
的仓库。
在myapp
BuildConfig.groovy
内部我需要将插件指定为插件:
plugins {
compile: "???"
}
我的问题:
compile
闭包(在BuildConfig.groovy
内)需要从Artifactory中拔出插件是什么意思?http://myartifactory01/artifactory/simple/myorg-releases/???
这样的东西?让我们假设在正常的Maven / Ivy情况下,organization
为myorg
,module
的名称为grails-myplguin
或myplugin
(无论惯例状态如何),当前revision
为0.1.0
。version
(在MyPluginPlugin.groovy
内),然后运行package-plugin
并将新版本发布到Artifactory?或者有更好/更优选的方式吗?答案 0 :(得分:2)
以下是我使用标准Artifactory安装的方式。
编辑:对于问题3,您可以提高插件描述符中的版本号,或者如果进行细微更改,您可以使用相同的版本号(--allow-overwrite
)重新发布它,并删除myApp'目标目录,它将强制安装新的插件。
/path/to/myPlugin/grails-app/conf/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/")
}
外壳:
cd /path/to/myPlugin
grails clean
grails compile
grails publish-plugin --allow-overwrite --noScm --repository=localPluginReleases
/path/to/myApp/grails-app/conf/BuildConfig.groovy:
repositories {
mavenRepo "http://localhost:8081/artifactory/plugins-snapshot-local/"
mavenRepo "http://localhost:8081/artifactory/plugins-release-local/"
}
plugins {
compile ":myplugin:0.1"
}