我如何发布一个grails 3插件到我的本地nexus回购? [英] How do I publish a grails 3 plugin to my local nexus repo?

查看:102
本文介绍了我如何发布一个grails 3插件到我的本地nexus回购?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行 grails publish-plugin 似乎没有做任何事情,我能找到的唯一文档是关于发布到bintray。

Running grails publish-plugin doesn't seem to do anything, and the only documentation I could find was about publishing to bintray.

[edit:]

我可以通过 gradle publish 发布插件,但想知道如果有一个grails-y的方式来做到这一点,并且不知道 grails publish-plugin 实际上会做什么:/ b / b

I can publish the plugin via gradle publish, but wondered if there was a grails-y way to do it, and wonder what grails publish-plugin actually does :/

推荐答案

我在 Ryan Vanderwerf 的帮助下找到了 http://rvanderwerf.blogspot.com/2015/07 /how-to-publish-grails-3-plugin.html ,他写道,有一堆没有版本的spring-boot依赖关系会导致gradle出现异常。要解决它,请删除没有版本的pom中的所有依赖项:

I figured it out with help from Ryan Vanderwerf at http://rvanderwerf.blogspot.com/2015/07/how-to-publish-grails-3-plugin.html who writes that there are a bunch of spring-boot dependencies that don't have versions in them and that causes gradle to freak out. To workaround it, strip out all dependencies in the pom that doesn't have versions:

publishing {
    publications {
        mavenJar(MavenPublication) {
            pom.withXml {
                def pomNode = asNode()
                pomNode.dependencyManagement.replaceNode {}

                // simply remove dependencies without a version
                // version-less dependencies are handled with dependencyManagement
                // see https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/8 for more complete solutions
                pomNode.dependencies.dependency.findAll {
                    it.version.text().isEmpty()
                }.each {
                    it.replaceNode {}
                }
            }
            from components.java
        }
    }
    repositories {
        maven {
            credentials {
                username "username"
                password "password"
            }
            url "http://localhost/repo"
        }
    }
}

然后您可以使用 grails publish-plugin gradle publish 发布您的插件

then you can use grails publish-plugin or gradle publish to publish your plugin

相关SO问题: Grails 3 - 如何发布到Artifactory

这篇关于我如何发布一个grails 3插件到我的本地nexus回购?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆