Java 无法对pom.xml正确实现spring安全性
stack overflow社区用户,我的项目中的spring安全实现有一个奇怪的问题: 如果我加上:Java 无法对pom.xml正确实现spring安全性,java,spring,spring-boot,maven,spring-security,Java,Spring,Spring Boot,Maven,Spring Security,stack overflow社区用户,我的项目中的spring安全实现有一个奇怪的问题: 如果我加上: <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-security --> <dependency> <groupId>org.springframework.boot</groupId> <artifac
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-security -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
org.springframework.boot
弹簧启动安全
关于pom.xml
发生这种情况:
sts:spring工具套件,在pom的第一行显示此错误
:
未能从中传输org.springframework.security:spring安全核心:jar:5.4.2https://repo.maven.apache.org/maven2 缓存在本地
存储库中,在经过central的更新间隔或强制更新之前,不会重新尝试解析。原始错误:无法传输工件
org.springframework.security:spring安全核心:jar:5.4.2 from/to central(https://repo.maven.apache.org/maven2):权限被拒绝:无进一步信息
org.eclipse.aether.transfer.ArtifactTransferException:未能从https://
repo.maven.apache.org/maven2缓存在本地存储库中,在经过central的更新间隔或更新完成之前,不会重新尝试解析
强迫。
我所做的:
右键单击project>maven>update project运行
运行项目>清理
一旦我删除了spring安全依赖项,错误就消失了,但我正试图在我的学习课程项目中实现spring安全,但由于上面解释的原因,我无法实现,请帮助
感谢foward此错误的解决方案很简单,请转到maven repository文件夹并将其删除。m2 然后转到STS-spring工具套件或Eclipse,右键单击,maven,updateproject,等待所有依赖项下载完毕,然后错误将消失
我希望此解决方案对其他遇到相同问题的用户有用@khelwood谢谢您的更正,已经修复了我的错误!,谢谢你有没有不受限制的网络连接?或者您是否必须使用可能未正确配置的代理服务器?@dunni通过删除所有依赖项并重新下载解决了此问题,谢谢!欢迎来到堆栈溢出!请不要在问题中编辑解决方案公告。接受(即单击旁边的“勾选”)现有答案之一(如果有)。如果您的解决方案尚未包含在现有答案中,您也可以创建自己的答案,甚至接受它。@Yunnosch非常有用您的建议,我接受它!,谢谢
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
Failure to transfer org.springframework.security:spring-security-core:jar:5.4.2 from 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. Original error: Could not transfer artifact
org.springframework.security:spring-security-core:jar:5.4.2 from/to central (https://repo.maven.apache.org/maven2): Permission denied: no further information
org.eclipse.aether.transfer.ArtifactTransferException: Failure to transfer org.springframework.security:spring-security-core:jar:5.4.2 from 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.