Maven 无法找到本地安装的工件,该工件仅存在于本地安装
Maven fails to find an artifact installed locally, that only exists installed locally
这与具有类似错误的现有问题有点不同 - 我不认为这是重复的。
我有一个项目 A,我使用 mvn clean install
在本地成功构建并安装了它。
我验证了 director ~/.m2/com/example/A/1.0/
中存在 jar 和 pom,并且它们没有损坏。
项目 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。
这与具有类似错误的现有问题有点不同 - 我不认为这是重复的。
我有一个项目 A,我使用 mvn clean install
在本地成功构建并安装了它。
我验证了 director ~/.m2/com/example/A/1.0/
中存在 jar 和 pom,并且它们没有损坏。
项目 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。