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

标签 gradle gradle-plugin multi-project artifact bintray

我有一个根项目和一些子项目,所有这些项目都会产生 Artifact 。
我以与构建 Artifact (相同的发布/配置)相似的方式在顶级构建脚本(gradle)中配置了bintray。
使用“artifactoryPublish”将 Artifact 上传到 Artifact 时,所有 Artifact (来自根项目和子项目)均已正确上传。
但是,在运行“bintrayUpload”时,仅上传了根项目中的 Artifact ,并且对于子项目,我收到这种错误:

> 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.

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

最佳答案

您未指定Bintray凭证。
在您的项目中提供以下详细信息。

build.gradle(libary module)


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=*****************

关于gradle - 使用gradle和bintray插件将子项目 Artifact 上传到Bintray,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47789887/

相关文章:

android - Gradle 构建失败 : cannot run a program

gradle - 无法从HTTP URL应用Gradle脚本插件

eclipse - Eclipse Gradle多项目

java - 为什么 Gradle 试图为我的项目查找资源包?

gradle - 我们将gradle升级到V3.3后,Jmockit代码覆盖范围停止工作

c - 使用我自己的库 : implicit declaration of function

gradle - 对于继承 3rd-Party Java 对象的 Groovy 对象,对 super 的构造调用失败

环境占位符的 Gradle 属性

android-studio - Android Rss Reader Library Gradle集成

gradle - 如何将Flyway升级到4.0