gpt4 book ai didi

gradle - gradle无法下载ua解析器文件

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

我正在尝试测试一些jenkins作业种子dsls,为此我需要在gradle中下载jenkins拥有的所有插件,其中一个是blueocean,在我的build.gradle中,我已经看到了这一行

    testPlugins 'io.jenkins.blueocean:blueocean:1.23.2'
我被抛出这个异常
* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not find ua_parser:ua-parser:1.3.0.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/ua_parser/ua-parser/1.3.0/ua-parser-1.3.0.pom
- https://repo.maven.apache.org/maven2/ua_parser/ua-parser/1.3.0/ua-parser-1.3.0.jar
- http://repo.jenkins-ci.org/releases/ua_parser/ua-parser/1.3.0/ua-parser-1.3.0.pom
- http://repo.jenkins-ci.org/releases/ua_parser/ua-parser/1.3.0/ua-parser-1.3.0.jar
- https://jcenter.bintray.com/ua_parser/ua-parser/1.3.0/ua-parser-1.3.0.pom
- https://jcenter.bintray.com/ua_parser/ua-parser/1.3.0/ua-parser-1.3.0.jar
Required by:
project : > io.jenkins.blueocean:blueocean:1.23.2 > io.jenkins.blueocean:blueocean-rest-impl:1.23.2
我尝试使用gradlew 4.8.16.0.1运行
我尝试addint ua-parser来build.gradle
    compile group: 'ua_parser', name: 'ua-parser', version: '1.3.0'
我尝试删除所有gradle缓存并刷新依赖项
rm -rf ~/.gradle/cache
./gradlew test --refresh-dependencies # or ./gradlew build ..
我禁用了vpn,因此不是某些防火墙不允许我连接到该站点,也许我存储了一些过时的gradle存储库? (我还不熟悉gradle,所以也许有些简单的事情在逃避我的视线)

编辑1:
我认为这可能与缺少存储库有关,因此尝试手动添加新存储库,我找到了 https://github.com/jenkinsci/blueocean-plugin并尝试将其添加到 settings.gradle
sourceControl {
gitRepository("https://github.com/jenkinsci/blueocean-plugin.git") {
producesModule("org.gradle.blueocean:utilities")
}
}
然后在 build.gradle中引用
  dependencies { 
...
implementation 'org.gradle.blueocean:utilities'
但似乎不起作用,有人知道如何添加/在何处搜索gradle存储库(特别是blueocean poms)

最佳答案

必须在build.gradle中的存储库中添加这些行

  repositories {
mavenCentral()
maven { url 'http://repo.jenkins-ci.org/releases/' }
maven { url 'https://mvnrepository.com/artifact/io.jenkins.blueocean' }
maven { url 'https://mvnrepository.com/artifact/ua_parser/ua-parser' }
maven { url 'https://mvnrepository.com/artifact' }
maven { url 'https://maven.twttr.com/' }

关于gradle - gradle无法下载ua解析器文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62531002/

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