spring 生成错误使用JsonReader,setLenient(true)接受第1行第1列路径$中格式错误的JSON

oknrviil  于 2023-04-28  发布在  Spring
关注(0)|答案(1)|浏览(151)

尝试构建Gradle项目时显示以下错误。我遇到的所有解决方案都没有帮助。这方面的任何帮助都将是巨大的。谢谢

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':service:compileTestJava'.
> Could not resolve all files for configuration ':service:testCompileClasspath'.
   > Could not resolve org.springframework.cloud:spring-cloud-function-compiler:3.0.6.RELEASE.
     Required by:
         project :service > org.springframework.cloud:spring-cloud-starter-contract-stub-runner:3.1.1 > org.springframework.cloud:spring-cloud-contract-stub-runner:3.1.1 > org.springframework.cloud:spring-cloud-contract-verifier:3.1.1
      > Could not resolve org.springframework.cloud:spring-cloud-function-compiler:3.0.6.RELEASE.
         > Could not parse POM https://artifactrepository.hilti.com/repository/CCoE.maven.group/org/springframework/cloud/spring-cloud-function-compiler/3.0.6.RELEASE/spring-cloud-function-compiler-3.0.6.RELEASE.pom
            > Could not resolve org.springframework.cloud:spring-cloud-function-parent:3.0.6.RELEASE.
               > Could not resolve org.springframework.cloud:spring-cloud-function-parent:3.0.6.RELEASE.
                  > Could not parse POM https://artifactrepository.hilti.com/repository/CCoE.maven.group/org/springframework/cloud/spring-cloud-function-parent/3.0.6.RELEASE/spring-cloud-function-parent-3.0.6.RELEASE.pom
                     > Could not resolve org.springframework.cloud:spring-cloud-build:2.2.3.RELEASE.
                        > Could not resolve org.springframework.cloud:spring-cloud-build:2.2.3.RELEASE.
                           > Could not parse POM https://artifactrepository.hilti.com/repository/CCoE.maven.group/org/springframework/cloud/spring-cloud-build/2.2.3.RELEASE/spring-cloud-build-2.2.3.RELEASE.pom
                              > Could not resolve org.springframework.cloud:spring-cloud-build-dependencies:2.2.3.RELEASE.
                                 > Could not resolve org.springframework.cloud:spring-cloud-build-dependencies:2.2.3.RELEASE.
                                    > Could not parse POM https://artifactrepository.hilti.com/repository/CCoE.maven.group/org/springframework/cloud/spring-cloud-build-dependencies/2.2.3.RELEASE/spring-cloud-build-dependencies-2.2.3.RELEASE.pom
                                       > Could not resolve org.springframework.boot:spring-boot-dependencies:2.2.5.RELEASE.
                                          > Could not resolve org.springframework.boot:spring-boot-dependencies:2.2.5.RELEASE.
                                             > Could not parse POM https://artifactrepository.hilti.com/repository/CCoE.maven.group/org/springframework/boot/spring-boot-dependencies/2.2.5.RELEASE/spring-boot-dependencies-2.2.5.RELEASE.pom
                                                > Could not resolve io.rsocket:rsocket-bom:1.0.0-RC6.
                                                   > Could not resolve io.rsocket:rsocket-bom:1.0.0-RC6.
                                                      > Could not parse module metadata https://artifactrepository.hilti.com/repository/CCoE.maven.group/io/rsocket/rsocket-bom/1.0.0-RC6/rsocket-bom-1.0.0-RC6.module
                                                         > Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
dced5bon

dced5bon1#

这个链接有帮助,但重要的是,你需要确保你给出了正确的仓库网址- www.example.com
换句话说,网页中的大多数解决方案如下所示:

repositories {
    maven {
        url "http://repo.mycompany.com/repo"
        metadataSources {
            mavenPom()
            artifact()
        }
    }
}

但它实际上应该是如何的URL需要指向导致问题的文件的父文件夹。比如说

repositories {
    maven {
        url "http://repo.mycompany.com/repo/a/b/c"
        metadataSources {
            mavenPom()
            artifact()
        }
    }
}

相关问题