我的pom.xml
中有此存储库:
<repositories>
<repository>
<id>spring-maven-release</id>
<name>Spring Maven Release Repository</name>
<url>http://maven.springframework.org/release</url>
</repository>
</repositories>
当我尝试构建应用程序时,出现如下错误:
im@im:~/projects/nsn_maintenance_be/maintenance$ mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building maintenance 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for javax.xml.crypto:xmldsig:jar:1.0 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.770 s
[INFO] Finished at: 2019-05-22T19:09:32+03:00
[INFO] Final Memory: 11M/211M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project maintenance: Could not resolve dependencies for project com.ia:maintenance:war:1.0-SNAPSHOT: Failure to find javax.xml.crypto:xmldsig:jar:1.0 in http://maven.springframework.org/release was cached in the local repository, resolution will not be reattempted until the update interval of spring-maven-release has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
这个错误让我有些困惑,不确定应该怎么做,因为我可以在本地存储库中看到这个库:
答案 0 :(得分:0)
我认为行家确实无法识别pom。 在常规情况下,jar和pom应该驻留在本地存储库中的相应文件夹中,没有任何后缀(如显示的代码段中的“ lastUpdated”)。
尝试完全删除文件夹~/.m2/repository/javax/xml/crypto/xmldsig/1.0
并运行Maven。很有可能它将再次带上罐子和pom,并且这次不会失败(您可以备份,而不是删除存储库之外的内容,只是附带说明:))
答案 1 :(得分:0)
xmldsig在您配置的存储库中不可用。
仅删除整个“存储库”部分,默认情况下,您应指向Maven Central,该中心具有http://maven.springframework.org/release的所有库以及构建项目所需的所有库。