带有人工工件Gradle插件的单独发布任务

时间:2018-10-10 08:29:44

标签: gradle artifactory gradle-plugin

我正在尝试配置单独的工件发布任务。完成此任务后,我不想发布该项目的常规出版物,而希望发布另一本出版物。

以下设置适用于工件Gradle插件4.4.12-但使用4.7.3时,发布不再部署到工件。

我可以看到任务generatePomFileForPaypalWiremockPublicationpublishPaypalWiremockPublicationToMavenLocal。但是运行任务publishRecordedStubs不会静默部署工件。

//generate the artifact containing the paypal stubs
task('paypalWiremock', type: org.gradle.jvm.tasks.Jar, dependsOn: 'stubRecording') {
    baseName = "paypal-express-app-wiremock"
    group = 'Build'
    from('build/wiremock-stubs') {
        include '**/*'
        into "wiremock/paypal"
        includeEmptyDirs = false
    }
}

//separate publication definitions for jar with wiremock stubs
//since we do not want this to be published on master builds
publishing {
    publications {
        paypalWiremock(MavenPublication) {
            artifact tasks.paypalWiremock {
                artifactId "paypal-express-app-wiremock"
            }
        }
    }
}

//tasks publishing the paypal wiremock stub jar
task ('publishRecordedStubs', type: ArtifactoryTask, dependsOn: ['generatePomFileForPaypalWiremockPublication', 'paypalWiremock']) {
    publications('paypalWiremock')
}

不幸的是,在这种情况下似乎没有任何例子。非常感谢您对此工作的任何帮助。

0 个答案:

没有答案