gpt4 book ai didi

gradle - 失败:由于构建RxJava时无法下载工件,因此构建失败并发生异常

转载 作者:行者123 更新时间:2023-12-03 04:05:56 25 4
gpt4 key购买 nike

出现以下异常,RxJava项目构建失败的原因可能是什么?

jacek:~/oss/RxJava
$ ./gradlew build -x test
...
:rxjava-contrib:rxjava-android:compileJava
Download http://repo1.maven.org/maven2/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.pom
Download http://repo1.maven.org/maven2/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':rxjava-contrib:rxjava-android:provided'.
> Could not download artifact 'org.apache.maven:maven-error-diagnostics:2.2.1@jar'
> Artifact 'org.apache.maven:maven-error-diagnostics:2.2.1@jar' not found.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 48.057 secs

最佳答案

当您看到错误时,很可能您的~/.m2/repository包含部分解析的依赖项(在这种情况下,它是org.apache.maven:maven-error-diagnostics:2.2.1@jar):

$ ls ~/.m2/repository/org/apache/maven/maven-error-diagnostics/2.2.1/
_maven.repositories maven-error-diagnostics-2.2.1.pom maven-error-diagnostics-2.2.1.pom.sha1

只需从 ~/.m2/repository中删除依赖项的目录...
$ rm -rf ~/.m2/repository/org/apache/maven/maven-error-diagnostics/2.2.1/

...然后重新运行构建。现在应该可以正常构建了。
jacek:~/oss/RxJava
$ ./gradlew build -x test
...
:rxjava-contrib:rxjava-swing:build

BUILD SUCCESSFUL

Total time: 1 mins 48.046 secs

关于gradle - 失败:由于构建RxJava时无法下载工件,因此构建失败并发生异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22338141/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com