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

将下述代码保存成pom.xml


<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.0modelVersion>
    <groupId>org.jasig.casgroupId>
    <artifactId>cas-overlayartifactId>
    <packaging>warpackaging>
    <version>1.0version>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.pluginsgroupId>
                <artifactId>maven-war-pluginartifactId>
                <version>3.2.2version>
                <configuration>
                    <warName>caswarName>
                    <overlays>
                        <overlay>
                            <groupId>org.jasig.casgroupId>
                            <artifactId>cas-server-webappartifactId>
                        overlay>
                    overlays>
                configuration>
            plugin>
        plugins>
        <finalName>casfinalName>
    build>

    <dependencies>
        <dependency>
            <groupId>org.jasig.casgroupId>
            <artifactId>cas-server-webappartifactId>
            <version>4.2.7version>
            <type>wartype>
            <scope>runtimescope>
        dependency>
    dependencies>

    <properties>
        <maven.compiler.source>1.8maven.compiler.source>
        <maven.compiler.target>1.8maven.compiler.target>
        <project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
    properties>

    <repositories>
        <repository>
            <id>sonatype-releasesid>
            <url>http://oss.sonatype.org/content/repositories/releases/url>
        repository>
        <repository>
            <id>sonatype-snapshotsid>
            <url>https://oss.sonatype.org/content/repositories/snapshots/url>
        repository>
        <repository>
            <id>shibboleth-releasesid>
            <url>https://build.shibboleth.net/nexus/content/repositories/releasesurl>
        repository>
    repositories>
project>

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

mvn clean package

耐心等待一会儿,首次执行会下载40MB左右的文件,下载完成后再次执行就很快了,mvn是maven命令,如不了解maven,可先百度看下maven相关资料,能配出来一个可以执行maven命令的环境即可。
上述命令执行完成后就会在target文件夹(该文件夹会自动生成)下看到cas.war文件了。

注:该4.2.7版本的cas.war包内会有jar包冲突,删除/WEB-INF/lib/下的cas-server-core-logging-4.2.7.jar即可。

原创不易,转帖请注明出处——–shizhongqi

你可能感兴趣的:(单点登录CAS4.2.7MAVEN打WAR包教程)