pom.xml dependencies -> 6.3.x?

100 views
Skip to first unread message

Bill Scully

unread,
Mar 2, 2021, 4:18:43 PM3/2/21
to CAS Community
Hi,

I am coming from working with 5.2.x, trying to start fresh with 6.3.x and having a difficult time wrapping my head around including dependencies in the overlay.  For example, in 5.2.x, I would add the following in pom.xml:

<dependency>
        <groupId>org.apereo.cas</groupId>
        <artifactId>cas-server-support-ldap</artifactId>
        <version>${cas.version}</version>
</dependency>

The same format is listed at https://apereo.github.io/cas/6.3.x/installation/LDAP-Authentication.html.  However, I can't find where pom.xml is used in 6.x and it appears that dependencies must now be placed in build.gradle in a different format, different that the documented format above.

Sorry, you guys must roll you eyes reading this, but my brain is about to explode trying to figure out what I am missing.

Thanks for reading this and any guidance you can offer.

Bill

Ray Bon

unread,
Mar 2, 2021, 4:51:42 PM3/2/21
to cas-...@apereo.org
Bill,

In build.gradle, there is a top level dependencies section (not the one in buildscript). You add your dependency with:

    runtimeOnly "org.apereo.cas:cas-server-support-ldap:${casServerVersion}"


Ray

On Tue, 2021-03-02 at 13:18 -0800, Bill Scully wrote:
Notice: This message was sent from outside the University of Victoria email system. Please be cautious with links and sensitive information.
-- 
Ray Bon
Programmer Analyst
Development Services, University Systems

I respectfully acknowledge that my place of work is located within the ancestral, traditional and unceded territory of the Songhees, Esquimalt and WSÁNEĆ Nations.

King, Robert

unread,
Mar 3, 2021, 9:25:15 AM3/3/21
to cas-...@apereo.org

Ray,

 

Thanks for the link.  Great to see work on initializr moving forward as it addresses a lot of the dependency/feature learning curve.

 

Just decided to give cas via initalizr a try.  Unfortunately the “./gradlew clean build” fails with the following error:

 

* What went wrong:

Execution failed for task ':compileJava'.

> error: release version 11 not supported

 

I thought Java 11 is the target version for CAS 6.3?

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/8e63b0f705a3f9fef3a49b79153e9ef2149d4b0d.camel%40uvic.ca.

Ray Bon

unread,
Mar 3, 2021, 11:25:01 AM3/3/21
to cas-...@apereo.org
Robert,

Try 'clean build' on a fresh clone of 6.3 overlay to make sure that gradlew is in fact using the correct jdk.
You may then have to add some debugging to gradlew to find out what 'version 11' is actually referring to.

Ray

Bill Scully

unread,
Mar 3, 2021, 11:31:17 AM3/3/21
to CAS Community, Ray Bon
Hi Ray,

Thanks a lot for your help.

I had seen that blog before posting in this forum, but wondered how those instructions reconciled with the guidance on https://apereo.github.io/cas/6.3.x/.  I am trying to be independent of forums, so as not to bother you guys with basic learning curve questions, but am personally finding gaps in official documentation and getting CAS configured and running.  I suppose I really am missing something.

Is there somewhere on https://apereo.github.io/cas/6.3.x/ that I could have figured "runtimeOnly "org.apereo.cas:cas-server-support-ldap:${casServerVersion}" out and that you could point me to?  I am more than happy to do the grunt work and really don't want to bother everyone with my simple questions.

Thanks again for your help.

Bill

Ray Bon

unread,
Mar 3, 2021, 11:45:26 AM3/3/21
to fwsc...@gmail.com, cas-...@apereo.org
Bill,

The 'runtimeOnly' bit is part of gradle (there are identifiers for 'implementation' 'testCompileOnly' etc). The gradle docs really do not describe what these options mean or how/when to use them. You will have to search some blogs if you want to understand the dependency section of gradle.
For Cas, runtimeOnly will cover the configuration dependencies (since they are pulled in as jars during the build). If you are overriding classes, other dependency identifiers will be required.

Ray

Bill Scully

unread,
Mar 3, 2021, 12:01:57 PM3/3/21
to CAS Community, Ray Bon, Bill Scully
Thanks again.

So, as I understand it, the documentation on https://apereo.github.io/cas/6.3.x/ is really not sufficient to install and configure CAS and, in some cases, is misleading.  Take for example, enabling LDAP Authentication.  Apereo's documented steps to enabling LDAP are stated here:  https://apereo.github.io/cas/6.3.x/installation/LDAP-Authentication.html.  However, this is very different than the step(s) you have given me.

<dependency>
     <groupId>org.apereo.cas</groupId>
     <artifactId>cas-server-support-ldap</artifactId>
     <version>${cas.version}</version>
</dependency>

is what I used in my 5.x pom.xml, which no longer appears to be used in 6.x.  Is that right?  So is this 5.x configuration under 6.x. documentation that is no longer relevant?

Interestingly, I found the documentation under CAS 5.x to be completely sufficient to install and configure a CAS instance and I am not sure what happened under 6.x, which is why I am wondering if I am missing something obvious.

Thank you, Ray, for your patience with my questions.

King, Robert

unread,
Mar 3, 2021, 12:28:26 PM3/3/21
to cas-...@apereo.org

Initializr pulls down cas 6.4.0-RC1.  When running a clean build on cas-overlay-template branch 6.3, it builds just fine.  This leads me to believe that this is likely an issue with the build process for 6.4.

Ray Bon

unread,
Mar 3, 2021, 1:04:40 PM3/3/21
to fwsc...@gmail.com, cas-...@apereo.org
Bill,

You are not missing anything. I am not sure why the dependency part has not been updated. I want to help out with documentation but just have not had the time.
There was a transition period, I think, when both maven and gradle builds were available, now it is only gradle.
Another thing to keep in mind is that some of the properties may have changed names. So you will have to step through your properties file, line by line.

Ray

Bill Scully

unread,
Mar 4, 2021, 12:00:11 PM3/4/21
to CAS Community, Ray Bon, Bill Scully
Hi Ray,

Many thanks for clarifying where the documentation currently stands and I appreciate the tips, too.

Bill

Petr Bodnár

unread,
Apr 3, 2021, 7:20:37 AM4/3/21
to CAS Community, Bill Scully, Ray Bon
HI there,

unlike what one might take from this conversation, IMO the Maven overlay still seems to be pretty viable solution for those who don't want to bother with Gradle complexity, with support in their favorite IDE like Eclipse, or for those who just don't have time to learn Gradle. I've just tested with the latest CAS 6.3.3 version and my CAS project still builds just fine. Here is an example pom.xml that may help you with getting started:

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

    <properties>
        <cas.version>6.3.3</cas.version>
        <java.version>11</java.version>
    </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>

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


        <dependency>
            <groupId>org.apereo.cas</groupId>
            <artifactId>cas-server-support-ldap</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <warName>cas</warName>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <overlays>
                        <overlay>
                            <groupId>org.apereo.cas</groupId>
                            <artifactId>cas-server-webapp</artifactId>
                            <excludes>
                            </excludes>
                        </overlay>
                    </overlays>
                </configuration>
            </plugin>
        </plugins>
        <finalName>cas</finalName>
    </build>

</project>


Feel free to correct me, maybe I missed something.
Reply all
Reply to author
Forward
0 new messages