Grails 3 - How to publish to Artifactory

北城以北 提交于 2019-12-23 17:08:37

问题


I have several Grails 3 projects. Most are plugins and one is the main app that depends on the plugins.

Can someone who has successfully published a Grails 3 project to an Artifactory repo tell me how you did it? What gradle plugin do you use and what do you need to add to your build.gradle to make it work?

Regards, Rob


回答1:


I blogged the answer:

http://rvanderwerf.blogspot.com/2015/07/how-to-publish-grails-3-plugin.html

Basically you need to strip out anything in the POM with no version on it as Grails/Boot managed those deps.




回答2:


I just started working with grails 3, specifically version 3.2.8.

I found that placing the following entry at the end of build.gradle works where artifactory_user, artifactory_password, artifactory_snapshotUrl, and artifactory_releaseUrl are defined in gradle.properties.

publishing {
    repositories {
        maven {
            credentials {
                username artifactory_user
                password artifactory_password
            }
            if (version.endsWith('SNAPSHOT')) {
                url artifactory_snapshotUrl
            } else {
                url artifactory_releaseUrl
            }
        }
    }
}

File gradle.properties reads:

grailsVersion=3.2.8
grailsWrapperVersion=1.0.0
gormVersion=6.0.9.RELEASE
gradleWrapperVersion=3.4.1

app_version=0.0.1-SNAPSHOT
artifactory_user=admin
artifactory_password=password
artifactory_contextUrl=http://myserver.myorg.org:8081/artifactory
artifactory_snapshotUrl=http://myserver.myorg.org:8081/artifactory/libs-snapshot-local
artifactory_releaseUrl=http://myserver.myorg.org:8081/artifactory/libs-release-local


来源:https://stackoverflow.com/questions/30956826/grails-3-how-to-publish-to-artifactory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!