开发环境准备
1.下载并配置idea开发工具
-Xms2g
-Xmx8g
-XX:NewRatio=3
-Xss16m
-XX:ReservedCodeCacheSize=840m
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled
-XX:ConcGCThreads=4
-XX:+AlwaysPreTouch
-XX:+TieredCompilation
-XX:+UseCompressedOops
-XX:SoftRefLRUPolicyMSPerMB=50
-Dsun.io.useCanonCaches=false
-ea
-XX:MaxPermSize=512m
-XX:PermSize=512m
-Xverify:none
-XX:CICompilerCount=2
-Dsun.io.useCanonPrefixCache=false
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Djdk.attach.allowAttachSelf
-Dkotlinx.coroutines.debug=off
-Djdk.module.illegalAccess.silent=true
-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA 2019.2.3\bin\JetbrainsIdesCrack-4.2.jar
2.下载jdk1.8,以及配置maven
(1)这里需要注意的是jdk中的cacerts证书必须是jdk自带的,在编译代码时有用。等代码编译完成后在更换项目中需要的证书文件
(2)修改apache-maven-3.3.9\conf\settings.xml文件,在文件中最下中添加以下内容
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun_maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>securecentral</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>securecentral</id>
<!--Override the repository (and pluginRepository) "central" from the
Maven Super POM -->
<repositories>
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
3.源码导入idae(这里需要注意先将jdk和maven配置好之后在导源码)
(1)配置jdk
点击File–>Project Structure
(2)配置maven
点击File–>Settings…
(3)源码导入
源码下载 https://github.com/apereo/cas-overlay-template,选择需要的CAS5以上版本就行,下载到本地
打开IDEA点击File–>New–>Project from Existing Sources… 选择下载的源码文件,该项目是maven·项目,一直next就行。第一次编译时大约需要半个小时,因为需要下载cas相关的jar。
(4)创建项目文件(src–main–java和resources文件)
(5)配置tomcat8(尽量从官网下载一个新的tomcat使用)
(6)启动服务,访问CAS.
这里需要注意下起服务可能会有乱码
在最下面加入下面代码
-Dfile.encoding=UTF-8
CAS默认账号:casuser,密码:Mellon