【问题标题】:spring boot dependency issue with plexus-utils libraryplexus-utils 库的 Spring Boot 依赖问题
【发布时间】:2021-03-08 02:32:22
【问题描述】:

似乎 spring boot starter plexus-util 使用的库之一已经开始破坏。我收到相同的未经授权的错误。我正在使用 Spring Boot 2.1 版。正如我可以在 repo 中检查的那样,最近的更改很少。似乎有人增加了图书馆的授权要求。有没有人遇到过类似的问题?有没有其他方法,比如直接包含依赖的jar?或者使用弹簧启动的替代回购。 我在这里使用 gradle 作为依赖项。

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'commerce-tagging-service'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not download plexus-utils-2.1.jar (org.codehaus.plexus:plexus-utils:2.1)
      > Could not get resource 'https://repo.spring.io/plugins-release/org/codehaus/plexus/plexus-utils/2.1/plexus-utils-2.1.jar'.
         > Could not GET 'https://repo.spring.io/plugins-release/org/codehaus/plexus/plexus-utils/2.1/plexus-utils-2.1.jar'. Received status code 401 from server: Unauthorized

Spring Boot 的 Gradle 依赖项


implementation "org.springframework.boot:spring-boot-starter-web:${springBootVersion}"

【问题讨论】:

  • 您不应该使用 Spring 存储库来解决这些依赖关系。这些回购的政策已经改变,请参阅spring.io/blog/2020/10/29/…。因此,请改用常规的 maven Central 等。

标签: java spring-boot gradle


【解决方案1】:
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
                <id>central</id>
                <url>http://repo1.maven.org/maven2</url>
            </repository>```
 Adding the central repos to your maven settings.xml , should work.

【讨论】:

    【解决方案2】:

    尝试将此应用于构建文件:

    allprojects {
        repositories {
            jcenter()
            maven { url 'https://dl.bintray.com/kategory/maven' }
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2015-08-10
      • 2016-12-12
      • 1970-01-01
      • 2015-05-17
      • 1970-01-01
      • 1970-01-01
      • 2020-09-25
      • 2016-09-02
      • 2021-12-14
      相关资源
      最近更新 更多