maven copy-dependencies在状态403 forbidden上失败



我正在工作的项目使用Vaadin框架(旧版本7)和java 8。项目以多个项目(模块)的形式实施。在昨天之前的几个月里一切都很好。我对项目的"核心"部分做了一些改变,运行mvn install并跳转到主项目。

mvn clean
mvn dependency:copy-dependencies

将我的更改和依赖项从核心复制到主项目。最后一个目标(复制依赖)总是失败,并出现此错误(注意,我故意在错误消息中包含了一些信息):

[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------< myproject.main >-------------------------
[INFO] Building Main version
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from mvn-repository jetty: https://mvnrepository.com/artifact/com/vaadin/addon/jpacontainer/3.1.1/jpacontainer-3.1.1.pom
Downloading from mvn-repository jetty: https://mvnrepository.com/artifact/com/vaadin/addon/vaadin-touchkit-agpl/3.0.0/vaadin-touchkit-agpl-3.0.0.pom
Downloading from mvn-repository jetty: https://mvnrepository.com/artifact/org/vaadin/resetbuttonfortextfield/1.2.1/resetbuttonfortextfield-1.2.1.pom
Downloading from mvn-repository jetty: https://mvnrepository.com/artifact/org/vaadin/addon/confirmdialog/2.1.2/confirmdialog-2.1.2.pom
Downloading from mvn-repository jetty: https://mvnrepository.com/artifact/com/vaadin/tapio/googlemaps/0.6.1/googlemaps-0.6.1.pom
Downloading from mvn-repository jetty: https://mvnrepository.com/artifact/org/vaadin/addons/contextmenu/4.5/contextmenu-4.5.pom
Downloading from mvn-repository jetty: https://mvnrepository.com/artifact/org/vaadin/addons/lazyquerycontainer/vaadin-lazyquerycontainer/7.3.3.6/vaadin-lazyquerycontainer-7.3.3.6.pom
Downloading from mvn-repository jetty: https://mvnrepository.com/artifact/org/vaadin/addons/popupbutton/2.6.0/popupbutton-2.6.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.383 s
[INFO] Finished at: 2021-08-17T11:37:09+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project main: Could not resolve dependencies for project *myproject.core:version*: Failed to collect dependencies at *myproject.core:version* -> com.vaadin.addon:jpacontainer:jar:3.1.1: Failed to read artifact descriptor for com.vaadin.addon:jpacontainer:jar:3.1.1: Could not transfer artifact com.vaadin.addon:jpacontainer:pom:3.1.1 from/to mvn-repository jetty (https://mvnrepository.com/artifact/): authorization failed for https://mvnrepository.com/artifact/com/vaadin/addon/jpacontainer/3.1.1/jpacontainer-3.1.1.pom, status: 403 Forbidden -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

奇怪的是,我不知道项目或我的电脑有什么变化会导致这个问题。

我已经试过了:

  • mvn -U dependencies:copy-dependencies
  • 在尝试复制依赖项之前运行mvn包(失败并出现相同的错误)
  • 重置Intellij环境
  • 重新编译所有依赖项目

我从错误消息中阅读了wiki文章,但我不认为它有多大用处-在此之前的项目工作没有我必须设置例如代理或TLS。你对如何解决这个问题有什么建议吗?

问题确实出在maven存储库链接上。似乎依赖关系最近发生了变化。

在我的例子中,解决方案是删除POM中引起麻烦的存储库,即

<repository>
<id>mvn-repository jetty</id>
<url>https://mvnrepository.com/artifact/</url>
</repository>

最新更新