gpt4 book ai didi

java - Maven 找不到本地安装的 Artifact ,该 Artifact 仅存在于本地安装

转载 作者:行者123 更新时间:2023-12-01 09:50:56 30 4
gpt4 key购买 nike

这与具有类似错误的现有问题有点不同 - 我不认为这是重复的。

我有项目 A,我使用 mvn clean install 在本地成功构建并安装了该项目。

我验证了director中存在jar和pom~/.m2/com/example/A/1.0/并且它们没有损坏。

项目 B 使用项目 A 作为依赖项。足够简单:

<dependency>
<groupId>com.example</groupId>
<artifactId>A</artifactId>
<version>1.0</version>
</dependency>

当我尝试构建 B 时,出现此错误:

Failed to execute goal on project B: Could not resolve dependencies for project com.example:B:jar:1.0-SNAPSHOT: 
Failure to find com.example:A:jar:1.0 in https://repo.maven.apache.org/maven2 was cached in the local repository,
resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

我清理了我读取的失败缓存文件_remote.repositories_maven.repositories

问题仍然出现。我的maven版本是3.3.1

最佳答案

您可以删除目录 ~/.m2/com/example/A/1.0/并重新安装 A ,然后使用 -U 选项构建 B 。

关于java - Maven 找不到本地安装的 Artifact ,该 Artifact 仅存在于本地安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37605068/

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