gradle release插件发布 - 意见

时间:2017-04-06 16:11:37

标签: nexus gradle-release-plugin

我试图使用gradle release plugin在私有nexus存储库上部署我的工件,但实际上我在上传存档fase期间遇到了问题。

上传到达终点,即使nexus用400回答,但在发布库中,我发现每种版本都是evene dev- *里程碑 - *

我希望在发布存储库上只有rc- *或最终版本,而快照存储库上的dev- *和milestone- *

实际上我的配置是

plugins {
id 'org.ajoberstar.grgit' version '1.7.0'
id 'org.ajoberstar.git-publish' version '0.2.0'

id 'org.ajoberstar.release-opinion' version '1.7.0'
}    apply plugin: 'java'
apply plugin: 'maven'


group = 'social.picnik.backend'
//version = '3.31.3-SNAPSHOT'

description = " --backend-services-- "

sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'
}

tasks.release.dependsOn 'build', 'uploadArchives'


uploadArchives {
    repositories {
        mavenDeployer {
            repository(url: "${nexusUrl}/content/repositories/releases") {
                authentication(userName: nexusUsername, password: nexusPassword)
            }
            snapshotRepository(url: "${nexusUrl}/content/repositories/snapshots") {
                authentication(userName: nexusUsername, password: nexusPassword)
            }
        }
    }
}

wrapper {
    gradleVersion = '3.4'
}

dependencies 
......

我启动的命令是

gradle release

然后我在nexus发布存储库中找到了 这个版本

  

3.31.3-dev.22.uncommitted + c6e4922

我本来希望在快照存储库中看到它而不是发布

感谢您的时间

1 个答案:

答案 0 :(得分:0)

tasks.afterReleaseBuild.dependsOn uploadArchives

Should do the trick.