我正在尝试从 -files 自动生成和部署 Java 库.proto。第一部分,从我的.proto-files 生成 Java 源代码已经工作,并且 Jar-task 生成三个.jar-files:example.jar,example-javadoc.jar和example-sources.jar(in /build/libs)。但是,发布到 Bintray 失败。
plugins {
id 'java-library'
id "maven-publish"
id "com.jfrog.bintray" version "1.8.4"
}
repositories {
mavenLocal()
jcenter()
}
dependencies {
implementation("io.grpc:grpc-netty:1.21.0")
implementation("io.grpc:grpc-protobuf:1.21.0")
implementation("io.grpc:grpc-stub:1.21.0")
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
publications {
news(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId "de.example"
artifactId "example"
version "0.0.1-test.1"
}
}
}
bintray {
user = System.getenv("BINTRAY_USER")
key = System.getenv("BINTRAY_API_KEY")
publications = ["news"]
publish = true
pkg {
repo = "example-mvn"
name = "example"
userOrg = "example"
licenses = ["Apache-2.0"]
version {
name = "0.0.1-test.1"
vcsTag = "example_0.0.1-test.1"
}
}
}
生成的 jar 应该发布到 Bintray 但执行gradle bintrayUpload -DBINTRAY_USER=xxx -DBINTRAY_API_KEY=xxx --stacktrace会产生以下错误:
> Task :publishNewsPublicationToMavenLocal FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':publishNewsPublicationToMavenLocal'.
> Failed to publish publication 'news' to repository 'mavenLocal'
> Failed to install artifact de.example:example:jar:0.0.1-test.1: /home/jowan/.m2/repository/de/example/example/0.0.1-test.1/example-0.0.1-test.1.jar (No such file or directory)
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
森栏
相关分类