添加依赖项时出现丢失 Artifact 错误。 我得到的错误是这样的:
Missing artifact com.azure:azure-security-keyvault-secrets:jar:4.1.0
这是我的 pom.xml 文件:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.companyname.encryptionkeyclient</groupId>
<artifactId>encryptionkeyclient</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>encryptionkeyclient</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-security-keyvault-secrets</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>
</project>
我想原因是该包在maven上尚不可用,但是该包已经可用https://mvnrepository.com/artifact/com.azure/azure-security-keyvault-secrets/4.1.0 .
所以我不知道我在这里缺少什么,有人可以帮忙吗?谢谢。
最佳答案
您提供的镜像地址有“azure-security-keyvault-secrets”jar,在我的项目中它成功下载了这个jar(具有相同的镜像地址)。
您可以删除“repository”文件夹下的所有包并保存pom.xml,项目将重新下载所有包。问题将会消失。
关于java - 在 pom.xml 文件中添加依赖项时缺少 Artifact 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59726726/