我的新项目需要 javax.xml 包。我确实在 mvnrepository.com 中搜索并找到了一个:
<!-- https://mvnrepository.com/artifact/javax.xml/jaxrpc-api -->
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc-api</artifactId>
<version>2.0_EA1</version>
</dependency>
我想,第一个注释行是包存储库。如果我错了,请纠正我。我在我的中添加了以下部分pom.xml:
<repositories>
<repository>
<id>repo1</id>
<name>Repo 1</name>
<url>https://mvnrepository.com/artifact/javax.xml/jaxrpc-api</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc-api</artifactId>
<version>2.0_EA1</version>
</dependency>
</dependencies>
但看起来我弄错了 Maven 地址。
mvn compile 带来的错误:
[ERROR] Failed to execute goal on project test-xpath: Could not resolve dependencies for project com.kkk:test-xpath:jar:0.0.1-SNAPSHOT: Failure to find javax.xml:jaxrpc-api:jar:2.0_EA1 in https://mvnrepository.com/artifact/javax.xml/jaxrpc-api was cached in the local repository, resolution will not be reattempted until the update interval of repo1 has elapsed or updates are forced -> [Help 1]
我做错了什么以及如何解决?
UPD
删除存储库后,我收到错误:
Failed to execute goal on project test-xpath: Could not resolve dependencies for project com.kkk:test-xpath:jar:0.0.1-SNAPSHOT: Failure to find javax.xml:jaxrpc-api:jar:2.0_EA1 in https://mvnrepository.com/artifact/javax.xml/jaxrpc-api was cached in the local repository, resolution will not be reattempted until the update interval of repo1 has elapsed or updates are forced -> [Help 1]
UPD2
我了解到我应该将 spring 存储库添加到我的依赖项中:
<repositories>
<repository>
<id>repo1</id>
<name>Repo 1</name>
<url>http://repo.spring.io/plugins-release/</url>
</repository>
</repositories>
我已经删除.m2\repository\javax并做了maven clean
largeQ
饮歌长啸
喵喵时光机
相关分类