【问题标题】:Dependency is not using the correct maven repository依赖项未使用正确的 Maven 存储库
【发布时间】:2021-12-05 09:34:34
【问题描述】:

我正在尝试使用ManifestClasspath 插件来解决CreateProcess error=206, The filename or extension is too long 错误。我的build.gradle 看起来像这样:

buildscript {
    repositories {
        mavenLocal()
        mavenCentral()
        jcenter()
        maven {
            url "http://repo.maven.apache.org/maven2"
//            allowInsecureProtocol = true
        }
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }

    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
        classpath "org.owasp:dependency-check-gradle:$dependencyCheckVersion"
        classpath("org.springframework.cloud:spring-cloud-contract-gradle-plugin:${springCloudContractVersion}")
        classpath("org.springframework.cloud:spring-cloud-contract-pact:${springCloudContractVersion}")
        classpath "gradle.plugin.ua.eshepelyuk:ManifestClasspath:1.0.0"
    }
}

ext['elasticsearch.version'] = "7.1.0"

allprojects {
    apply plugin: 'maven'
    apply plugin: "ua.eshepelyuk.ManifestClasspath"
    ...
}

但是,现在我收到了这个错误:

Could not GET 'http://repo.maven.apache.org/maven2/gradle/plugin/ua/eshepelyuk/ManifestClasspath/1.0.0/ManifestClasspath-1.0.0.pom'. Received status code 501 from server: HTTPS Required

它需要使用https://plugins.gradle.org/m2/ 存储库,但它使用http://repo.maven.apache.org/maven2。如何指定它需要使用的存储库?

【问题讨论】:

    标签: maven gradle build.gradle


    【解决方案1】:

    更改此行"http://repo.maven.apache.org/maven2"

    转入"https://repo.maven.apache.org/maven2" 将解决此问题。

    因为它已经使用带有https://plugins.gradle.org/m2/ 的https,但它需要搜索第一个"http://repo.maven.apache.org/maven2" 即http。

    【讨论】:

      猜你喜欢
      • 2013-04-01
      • 2012-01-10
      • 2020-07-13
      • 1970-01-01
      • 1970-01-01
      • 2013-10-08
      • 2017-01-23
      • 1970-01-01
      • 2019-07-31
      相关资源
      最近更新 更多