【问题标题】:Upload subproject artifacts to Bintray using gradle and bintray plugin使用 gradle 和 bintray 插件将子项目工件上传到 Bintray
【发布时间】:2017-12-13 09:46:37
【问题描述】:

我有一个根项目和一些子项目,它们都产生了工件。 我在顶级构建脚本(gradle)中配置了 bintray,其方式与我为 artifactory 所做的类似(相同的发布/配置)。 当使用“artifactoryPublish”将工件上传到工件时,所有工件(来自根项目和子项目)都会正确上传。 然而,当运行“bintrayUpload”时,只上传来自根项目的工件,并且我收到子项目的这种错误:

> Task :sub1:bintrayUpload
Putting task artifact state for task ':sub1:bintrayUpload' into context took 0.0 secs.

Executing task ':sub1:bintrayUpload' (up-to-date check took 0.0 secs) due to:
  Task has not declared any outputs.
Gradle Bintray Plugin version: 1.8.0
Skipping task 'sub1:bintrayUpload' because user or apiKey is null.

看起来根项目中定义的配置尚未传递到子项目。我怎样才能做到这一点? 一些子项目代码是自动生成的,因此,我不想修改子项目构建脚本,并且想要顶部脚本中的所有逻辑。这可能吗?

【问题讨论】:

    标签: gradle gradle-plugin multi-project artifact bintray


    【解决方案1】:

    您没有指定 bintray 凭据。 在您的项目中提供如下详细信息。

    build.gradle(库模块)

    ext {
       bintrayRepo = "Awesome Library"
       bintrayName = "com.example.awesome-library"
       libraryName = "awesome-library"
    
       publishedGroupId = 'com.example.awesome-library'
       artifact = 'awesome_library'
       libraryVersion = '1.0'
    
       libraryDescription = "Description...."
       siteUrl = 'https://www.example.com/'
       gitUrl = 'https://github.com/me/awesome-library.git'
       developerId = '....'
       developerName = '....'
       developerEmail = '.....'
       licenseName = 'The Apache Software LIcense, Version 2.0'
       licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
       allLicenses = ["Apache-2.0"]
    }
    

    local.properties

    bintray.user=username
    bintray.apikey=*****************
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-17
      • 1970-01-01
      • 2013-12-06
      • 2015-08-03
      • 1970-01-01
      • 2018-07-19
      • 2018-08-05
      • 2018-08-09
      相关资源
      最近更新 更多