我正在嘗試從 -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 FAILEDFAILURE: 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.
1 回答

森欄
TA貢獻1810條經驗 獲得超5個贊
終于找到問題所在:配置工作正常,但在錯誤的環境中執行。我在 Windows 上工作,但從gradle bintrayUpload -DBINTRAY_USER=xxx -DBINTRAY_API_KEY=xxx --stacktrace
Ubuntu 子系統調用。從 Windows 中調用它工作正常。
添加回答
舉報
0/150
提交
取消