CAS学习

CAS官网: https://www.apereo.org/projects/cas

1.下载cas-4.0.1.tar.gz,解压后得到cas-4.0.1文件夹
2.修改pom.xml中Codehause资源下载地址改为:
https://repository-master.mulesoft.org/nexus/content/groups/public/
3.命令行到cas-4.0.1目录下,执行mvn eclipse:eclipse
4.eclipse导入maven项目,会报错(Plugin execution not covered by lifecycle configuration:xxx plugin)
在 cas-4.0.1\pom.xml 里的 build - pluginManagement  - plugins 节点加入
<plugin>
	<groupId>org.eclipse.m2e</groupId>
	<artifactId>lifecycle-mapping</artifactId>
	<version>1.0.0</version>
	<configuration>
		<lifecycleMappingMetadata>
			<pluginExecutions>
				<pluginExecution>
					<pluginExecutionFilter>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-checkstyle-plugin</artifactId>
						<versionRange>2.10</versionRange>
						<goals>
							<goal>checkstyle</goal>
						</goals>
					</pluginExecutionFilter>
					<action>
						<ignore />
					</action>
				</pluginExecution>
				<pluginExecution>
					<pluginExecutionFilter>
						<groupId>com.mycila.maven-license-plugin</groupId>
						<artifactId>maven-license-plugin</artifactId>
						<versionRange>1.9.0</versionRange>
						<goals>
							<goal>check</goal>
						</goals>
					</pluginExecutionFilter>
					<action>
						<ignore />
					</action>
				</pluginExecution>
				<pluginExecution>
					<pluginExecutionFilter>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>aspectj-maven-plugin</artifactId>
						<versionRange>1.4</versionRange>
						<goals>
							<goal>compile</goal>
						</goals>
					</pluginExecutionFilter>
					<action>
						<ignore />
					</action>
				</pluginExecution>
			</pluginExecutions>
		</lifecycleMappingMetadata>
	</configuration>
</plugin>

5.编译的时候跳过测试
<build>
  <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
    </plugins>
</build>



错误解决:
1.第一次登录后报错
java.lang.IllegalStateException: Cannot create a session after the response has been committed


解决:在/cas-server-webapp/src/main/webapp/WEB-INF/cas-servlet.xml中修改如下:
<bean id="terminateWebSessionListener" class="org.jasig.cas.web.flow.TerminateWebSessionListener" p:timeToDieInSeconds="5" />

猜你喜欢

转载自sljackson.iteye.com/blog/2296263
Cas