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

maven copy-dependencies fails on status 403 forbidden

我正在处理的项目使用 Vaadin 框架(旧版本 7)和 java8。项目作为多个项目(模块)实现。 几个月前一切正常,直到昨天。我对项目的 'core' 部分做了一些更改, 运行 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

奇怪的是,我不知道项目或我的电脑中有任何可能导致此问题的更改。

我已经试过了:

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

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

在我的例子中,解决方案是删除 POM 中导致问题的存储库,即

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