gpt4 book ai didi

java - 安装maven时无法找到 Artifact

转载 作者:行者123 更新时间:2023-11-28 22:48:34 27 4
gpt4 key购买 nike

当我在 bitbucket 网站和配置服务器 tomcat 中为一个项目安装 maven 时,出现以下错误。

    [INFO] --- maven-dependency-plugin:2.10:copy (default) @ authconfig 
[INFO] Configured Artifact: ch.smartlink:authconfig:0.0.1-SNAPSHOT:jar
Downloading: http://central.maven.org/maven2/ [...private link]
Downloading: http://central.maven.org/maven2/ [...private link]
[INFO] BUILD FAILURE
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-
dependency-plugin:2.10:copy (default) on project authconfig: Unable to
find artifact. Could not find artifact
ch.smartlink:authconfig:jar:0.0.1-SNAPSHOT in nexus
(http://central.maven.org/maven2/)
[ERROR] Try downloading the file manually from the project website.
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=ch.smartlink -
DartifactId=authconfig -Dversion=0.0.1-SNAPSHOT -Dpackaging=jar -
Dfile=/path/to/file
[ERROR] Alternatively, if you host your own repository you can deploy
the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=... -DartifactId=authconfig -
Dversion=0.0.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=
[url] -DrepositoryId=[id]
[ERROR] ...:authconfig:jar:0.0.1-SNAPSHOT
[ERROR] from the specified remote repositories:
[ERROR] nexus (http://central.maven.org/maven2/, releases=true,
snapshots=true)

如何解决?

最佳答案

如错误消息所述,maven 在官方 maven 存储库中找不到 Artifact 。您需要使用“mvn install:install-file”将它安装在您的本地存储库 (~/.m2/repository) 中,或者更好的是,告诉 Maven 在哪里可以找到它,在您的 pom 文件中添加一个存储库标签。

参见:https://maven.apache.org/guides/introduction/introduction-to-repositories.html

关于java - 安装maven时无法找到 Artifact ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48259374/

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