gpt4 book ai didi

maven - 无法传输 Artifact - 未授权

转载 作者:行者123 更新时间:2023-12-04 18:08:07 29 4
gpt4 key购买 nike

我想使用以下存储库中的 Artifact “eu.excitementproject:lap:jar:1.1.0:”:

http://hlt-services4.fbk.eu:8080/artifactory/repo/eu/excitementproject

我可以在没有任何授权的情况下直接从上面的链接下载jar。

但是,当我在计算机上安装 mvn 时,出现以下错误:
Could not transfer artifact eu.excitementproject:lap:pom:1.1.0 from/to excitement 
(http://hlt-services4.fbk.eu:8080/artifactory/repo/eu/excitementproject):
Not authorized

这是我的 pom.xml 的相关部分:
  <repositories>
<repository>
<id>excitement</id>
<name>excitement</name>
<url>http://hlt-services4.fbk.eu:8080/artifactory/repo/eu/excitementproject</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>eu.excitementproject</groupId>
<artifactId>lap</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>

我该怎么办?

最佳答案

您的 Maven 配置是:

  • 存储库 URL - http://hlt-services4.fbk.eu:8080/artifactory/repo/eu/excitementproject
  • 组 ID - eu.excitementproject
  • Artifact ID - lap
  • 神器版本 - 1.1.1 .

  • 因此, Artifact 的完整路径是 http://hlt-services4.fbk.eu:8080/artifactory/repo/eu/excitementproject/eu.excitementproject/lap/1.1.1/lap-1.1.1.pom .

    如果我打 this URL从任何 Web 浏览器,我都被要求使用基本的 HTTP 身份验证进行身份验证。这也正是 Maven 所看到的。因此,正如上面@Will 提到的,如果您希望继续使用此存储库 URL,则必须在本地 settings.xml 中为存储库配置身份验证设置。

    有趣的是,我可以打 http://hlt-services4.fbk.eu:8080/artifactory/repo/eu.excitementproject/lap/1.1.1/lap-1.1.1.pom没有问题。因此,如果您将存储库 URL 缩短为 http://hlt-services4.fbk.eu:8080/artifactory/repo ,你的构建将工作(我已经测试过)。

    关于maven - 无法传输 Artifact - 未授权,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21702338/

    29 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com