单点登录CAS4.2.7MAVEN打WAR包教程

将下述代码保存成pom.xml

<?xml version="1.0" encoding="utf-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd ">  
  <modelVersion>4.0.0</modelVersion>  
  <groupId>org.jasig.cas</groupId>  
  <artifactId>cas-overlay</artifactId>  
  <packaging>war</packaging>  
  <version>1.0</version>  
  <build> 
    <plugins> 
      <plugin> 
        <groupId>org.apache.maven.plugins</groupId>  
        <artifactId>maven-war-plugin</artifactId>  
        <version>2.6</version>  
        <configuration> 
          <warName>cas</warName>  
          <overlays> 
            <overlay> 
              <groupId>org.jasig.cas</groupId>  
              <artifactId>cas-server-webapp</artifactId>  
              <excludes> 
                <exclude>WEB-INF/cas.properties</exclude>  
                <exclude>WEB-INF/classes/log4j2.xml</exclude> 
              </excludes> 
            </overlay> 
          </overlays> 
        </configuration> 
      </plugin> 
    </plugins>  
    <finalName>cas</finalName> 
  </build>  
  <dependencies> 
    <dependency> 
      <groupId>org.jasig.cas</groupId>  
      <artifactId>cas-server-webapp</artifactId>  
      <version>${cas.version}</version>  
      <type>war</type>  
      <scope>runtime</scope> 
    </dependency> 
  </dependencies>  
  <properties> 
    <cas.version>4.2.7</cas.version> 
  </properties>  
  <repositories> 
    <repository> 
      <id>sonatype-releases</id>  
      <url>http://oss.sonatype.org/content/repositories/releases/</url> 
    </repository>  
    <repository> 
      <id>sonatype-snapshots</id>  
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url> 
    </repository>  
    <repository> 
      <id>shibboleth-releases</id>  
      <url>https://build.shibboleth.net/nexus/content/repositories/releases</url> 
    </repository> 
  </repositories> 
</project>

然后在pom.xml同级目录执行

mvn clean package

然后在target目录下就能看到你要的cas.war了,这个版本是4.2.7。

猜你喜欢

转载自blog.csdn.net/lianjunzongsiling/article/details/80556894