亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Gradle bintrayUpload 找不到生成的 jar

Gradle bintrayUpload 找不到生成的 jar

慕哥6287543 2023-03-02 16:33:27
我正在嘗試從 -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 --stacktraceUbuntu 子系統調用。從 Windows 中調用它工作正常。



查看完整回答
反對 回復 2023-03-02
  • 1 回答
  • 0 關注
  • 156 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號