CAS-6.6.x war overlay by maven

83 views
Skip to first unread message

Char Lin

unread,
Sep 4, 2023, 5:18:54 AM9/4/23
to CAS Community
Hi, all.

How to use the Maven build and package cas 6.6.x war?

I am not familiar with Gradle and the cost of learning is too high.

Thanks!

Ray Bon

unread,
Sep 5, 2023, 12:51:02 PM9/5/23
to cas-...@apereo.org

On Mon, 2023-09-04 at 01:53 -0700, 'Char Lin' via CAS Community wrote:
Notice: This message was sent from outside the University of Victoria email system. Please be cautious with links and sensitive information.

Char Lin

unread,
Sep 7, 2023, 12:48:18 AM9/7/23
to CAS Community, Ray Bon
Sorry, I didn't find cas6.6 build through maven from this web page.

Is cas6.6 just support by gradle?

Ray Bon

unread,
Sep 7, 2023, 2:04:00 PM9/7/23
to chaof...@foxitsoftware.com, cas-...@apereo.org
Are you trying to build cas as a developer or a an operator?
If you want to run cas as a sign on system, use the overlay, https://github.com/apereo/cas-overlay-template that is described in the previous link.

Ray

Petr Bodnár

unread,
Sep 7, 2023, 4:37:44 PM9/7/23
to CAS Community, Ray Bon, chaof...@foxitsoftware.com
Hi all,

AFAIK, Maven WAR overlays are supported - one just needs to prepare the corresponding pom.xml on their own. If all you need is to get your custom CAS war, a standard Maven build should be sufficient - we use this approach for years in the company I work for, and we haven't experienced any issue with it. (Also, I must admit I'm not a big fan of Gradle for many reasons, but that is for another story...)

If it helps, here is a "starter" pom.xml for building cas.war which you can deploy e.g. to Tomcat:

<?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>com.example.cas</groupId>
    <artifactId>cas</artifactId>
    <packaging>war</packaging>
    <version>1.0.0-SNAPSHOT</version>

    <properties>
        <cas.version>6.6.10</cas.version>
        <!-- also define properties like Java version for Maven compiler etc. -->
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apereo.cas</groupId>
                <artifactId>cas-server-support-bom</artifactId>
                <version>${cas.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.apereo.cas</groupId>
            <artifactId>cas-server-webapp</artifactId>
            <version>${cas.version}</version>
            <type>war</type>
            <scope>runtime</scope>
        </dependency>

        <!-- ===== Optional CAS modules ===== -->

        <!--  add dependencies as needed and as described in the CAS documentation -->
       
        <!-- ===== Dependencies for compilation ===== -->

        <!-- add CAS or other dependencies if you need to compile your own classes -->
       
    </dependencies>

    <build>
        <finalName>cas</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


Regards
Petr

Char Lin

unread,
Sep 8, 2023, 12:44:22 AM9/8/23
to CAS Community, Petr Bodnár, Ray Bon, chaof...@foxitsoftware.com

Petr, thank you very much! 

This 'pom.xml' is helpful to me. I will try to build cas war based on it.
Reply all
Reply to author
Forward
0 new messages