使用gradle和bintray插件将子项目工件上传到Bintray

时间:2017-12-13 09:46:37

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

我有一个根项目和一些子项目,所有这些都会产生工件。 我在顶层构建脚本(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.

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

1 个答案:

答案 0 :(得分:1)

您未指定二进制证书。 在您的项目中提供以下类似的详细信息。

  

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=*****************
相关问题