spring的sanpshot报错_运行spring security oauth2.0 github上的例子里报错找不到spring-security-oauth2:jar:2.3.5.BUILD-...

在尝试运行Spring Security OAuth2.0的示例项目时遇到找不到spring-security-oauth2:jar:2.3.5.BUILD-SNAPSHOT的错误。该错误是因为SNAPSHOT版本未在Maven仓库中找到。解决方案是下载源代码,手动打包成jar,并使用Maven的install命令将其添加到本地仓库。执行相关Maven命令后,项目可以成功运行。
摘要由CSDN通过智能技术生成

在官网上下载了spring security oauth2.0的例子,但是运行samples\oauth2\里的sparklr项目时,报错如下:

[WARNING] The requested profile "spring" could not be activated because it does not exist.

[ERROR]Failed to execute goal on project sparklr2: Could not resolve dependencies for project org.springframework.security.oauth:sparklr2:war:2.3.5.BUILD-SNAPSHOT: Failed to collect dependencies at org.springframework.security.oauth:spring-security-oauth2:jar:2.3.5.BUILD-SNAPSHOT: Failed to read artifact descriptor for org.springframework.security.oauth:spring-security-oauth2:jar:2.3.5.BUILD-SNAPSHOT: Failure to find org.springframework.security.oauth:spring-security-oauth-parent:pom:2.3.5.BUILD-SNAPSHOT in http://repo.spring.io/libs-snapshot was cached in the local repository, resolution will not be reattempted until the update interval of spring 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

上面的报错意思很简单,就是找不到spring-security-oauth2:jar:2.3.5.BUILD-SNAPSHOT这个jar包,但是不应该啊,直接从官网下的怎么可能找不到jar包,后来看到snapshot的后缀,心想是不是还是测试阶段,并没有放到maven仓库里,所以找不到。于是在下载的工程里找到了spring-security-oauth2这个项目。

这就简单了,把这个项目导入进来后手动打成jar包。再把jar包加到本地maven仓库即可。注意:这里不能直接复制到本地maven仓库的对应目录里,这样工程里还是不认的。必须用maven命令才行。命令如下:

mvn install:install-file -Dfile=E:\downloads\spring-security-oauth-master\spring-security-oauth-master\spring-security-oauth2\target\spring-security-oauth2-2.3.5.BUILD-SNAPSHOT.jar -DgroupId=org.springframework.security.oauth -DartifactId=spring-security-oauth2 -Dversion=2.3.5.BUILD-SNAPSHOT -Dpackaging=jar

再运行工程就不会报上面找不到jar包的错了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值