CAS 5.x搭建常见问题系列(3).Failure to find org.apereo.cas:cas-server-support-pm-jdbc:jar:5.1.9

时间:2021-06-06 13:53:43

错误内容


cas overlay的pom.xml增加了cas-server-support-pm-jdbc.jary依赖后,

打包(mvn package)出现如下的报错

D:\casoverlay\cas-overlay-template>mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building cas-overlay 1.0
[INFO] ------------------------------------------------------------------------
Downloading: http://oss.sonatype.org/content/repositories/releases/org/apereo/cas/cas-server-support-pm-jdbc/5.1.9/cas-s
erver-support-pm-jdbc-5.1..pom
Downloading: https://build.shibboleth.net/nexus/content/repositories/releases/org/apereo/cas/cas-server-support-pm-jdbc/
5.1./cas-server-support-pm-jdbc-5.1..pom
Downloading: https://repo.spring.io/milestone/org/apereo/cas/cas-server-support-pm-jdbc/5.1.9/cas-server-support-pm-jdbc
-5.1..pom
Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apereo/cas/cas-server-support-pm-jdbc/5.1.9/
cas-server-support-pm-jdbc-5.1..pom
[WARNING] The POM for org.apereo.cas:cas-server-support-pm-jdbc:jar:5.1. is missing, no dependency information availabl
e
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.015 s
[INFO] Finished at: --03T20::+:
[INFO] Final Memory: 23M/294M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project cas-overlay: Could not resolve dependencies for project org.apereo.cas:cas-ove
rlay:war:1.0: Failure to find org.apereo.cas:cas-server-support-pm-jdbc:jar:5.1. in http://oss.sonatype.org/content/rep
ositories/releases/ was cached in the local repository, resolution will not be reattempted until the update interval of
sonatype-releases has elapsed or updates are forced -> [Help ]
[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 ] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

CAS 5.x搭建常见问题系列(3).Failure to find org.apereo.cas:cas-server-support-pm-jdbc:jar:5.1.9

错误原因


这个可能是cas 5.1.9的一个bug,后台服务器竟然没有cas-server-support-pm-jdbc:jar的5.1.9版本造成的。

解决方法也很简单,使用cas的当前最新版本,我在写本文时最新的稳定版本是5.2.5。

修改pom.xml的版本号

    <properties>
<cas.version>5.2.5</cas.version>
<springboot.version>1.5.3.RELEASE</springboot.version>
<!-- app.server could be -jetty, -undertow, -tomcat, or blank if you plan to provide appserver -->
<app.server>-tomcat</app.server>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

重新打包 mvn package

就OK了