我有一个根项目和一些子项目,所有这些项目都会产生 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/