build from source with additional modules

72 views
Skip to first unread message

Scott Koranda

unread,
Mar 24, 2018, 12:32:34 PM3/24/18
to cas-...@apereo.org
Hi,

I would like to build CAS from source so that I can add some additional
debugging to troubleshoot an issue with the pac4j SAML2 client support
for version 5.2.x.

I did

git clone g...@github.com:apereo/cas.git cas-server
cd cas-server
git checkout 5.2.x
./gradlew war --parallel -x test -x javadoc -x check

The build completed successfully.

I was then able to do

sudo cp \
./webapp/cas-server-webapp/build/libs/cas-server-webapp-5.2.4-SNAPSHOT.war \
/var/lib/tomcat8/webapps/cas.war

restart Tomcat 8.5

and see the CAS server start up and access /cas/login.

I need, however, to add the module for pac4j support and for the JSON
service registry.

I see on this page

https://apereo.github.io/cas/developer/Build-Process-5X.html

the text

"To test the functionality provided by a given CAS module, execute the
following steps:

Add the module reference to the build script (i.e. build.gradle) of web
application you intend to run (i.e Web App, Management Web App, etc)"

and the example

implementation project(":support:cas-server-support-modulename")

I did add the line

implementation project(":support:cas-server-support-json-service-registry")

to the file

webapp/build.gradle

but when I copied over the war file and restarted Tomcat the configured
JSON service registry was not recognized.

What step am I missing to add the JSON service registry support to the
war file I build from source?

Thanks,

Scott K

Man H

unread,
Mar 25, 2018, 9:52:35 AM3/25/18
to cas-...@apereo.org
  Copy etc/cas/properties to /etc/cas/properties
Add modules relevant properties to that.

--
- 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/20180324163227.ca72ilrewnfdnojn%40paprika.local.

Scott Koranda

unread,
Mar 25, 2018, 9:59:47 AM3/25/18
to cas-...@apereo.org
Hi,

> Copy etc/cas/properties to /etc/cas/properties
> Add modules relevant properties to that.
> See
> https://apereo.github.io/cas/5.2.x/installation/Configuration-Properties.html

Thank you for your prompt reply, but this is not the information I need.

I have a working and configured CAS deployment deployed using a standard
Maven overlay approach. It is already configured to use the JSON service
registry and pac4j modules. I did that by appropriately adding
dependencies in my pom.xml file and then adding appropriate
configurations to /etc/cas/config/cas.properties.

Now I want to build CAS from source using gradle and use the same
configuration.

I am able to build from source as I detailed in my last note, but the
war file I build does not have the JSON service registry or pac4j
modules includes.

I need a detailed explanation or example of how I modify a gradle
build.gradle file to include the JSON service registry or pac4j module
in the war file built from source.

I would be grateful if someone could provide that information.

Thank you for your time.

Scott K

Man H

unread,
Mar 25, 2018, 10:12:15 AM3/25/18
to cas-...@apereo.org
This is not the information you gave on first place.
So try not to mislead answers.
Why you want to use gradle if you where using maven.

--
- 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.

Scott Koranda

unread,
Mar 25, 2018, 4:09:37 PM3/25/18
to cas-...@apereo.org
Apologies for answering my own post, but for the archives...

A correct recipe for building version 5.2.x from source with support for
the JSON service registry and the pac4j SAML functionality is

git clone g...@github.com:apereo/cas.git cas-server
cd cas-server
git checkout 5.2.x

Then edit the file

webapp/cas-server-webapp/build.gradle

and add the lines

dependencies {
implementation project(path: ":support:cas-server-support-json-service-registry")
implementation project(path: ":support:cas-server-support-pac4j-webflow")
}

Then execute

./gradlew war --parallel -x test -x javadoc -x check
sudo cp ./webapp/cas-server-webapp/build/libs/cas-server-webapp-5.2.4-SNAPSHOT.war /var/lib/tomcat8/webapps/cas.war

After restarting Tomcat8 the code built from source will be in effect.

Thanks,

Scott K

Scott Koranda

unread,
Mar 26, 2018, 10:21:32 AM3/26/18
to cas-...@apereo.org
Hi,

> This is not the information you gave on first place.
> So try not to mislead answers.

Again, thank you for your time. I appreciate that this is a community
effort.

I do not believe I have provided misleading information. My first note
explained that I am building CAS from source following the instructions
at

https://apereo.github.io/cas/developer/Build-Process-5X.html

The instructions show how to build CAS from source using Gradle.

> Why you want to use gradle if you where using maven.

I am using Maven with the overlap approach for production deployments.

For building from source in order to help debug an issue with pac4j SAML
in version 5.2 so that I may contribute back to the community I need to
build a war file that includes the pac4j and JSON service registry
functionality.

I would like additional details not provided at the link

https://apereo.github.io/cas/developer/Build-Process-5X.html

on how to do that.

I appreciate any insights that can provided.

Thank you again,

Scott K
> To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAMY5midiAa0_rXt1AefQ9M%2B4YmbfGNBtYyet8BnTPwuShXYuDw%40mail.gmail.com.

Juan David Sánchez

unread,
Mar 10, 2019, 6:10:49 AM3/10/19
to CAS Community
Hi Scott,

I was looking for the same thing myself.

I found this link, which gave me the right answers to include additional support modules: https://apereo.github.io/2018/11/20/cas60x-codebase-feature-build/

It applies to version 6.0.x but I hope you can find it useful.

Cheers
Reply all
Reply to author
Forward
0 new messages