apereo/cas-gradle-overlay-template

Name: cas-gradle-overlay-template

Owner: Apereo Foundation

Description: CAS Gradle Overlay: Generic CAS gradle war overlay to exercise the latest versions of CAS

Created: 2016-08-02 08:41:04.0

Updated: 2018-05-21 08:34:03.0

Pushed: 2018-05-21 08:34:01.0

Homepage: https://apereo.github.io/cas

Size: 277

Language: Shell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

CAS Gradle Overlay

Generic CAS Gradle war overlay to exercise the latest versions of CAS. This overlay could be freely used as a starting template for local CAS Gradle war overlays.

Versions
Requirements
Configuration

The etc directory contains the configuration files that are copied to /etc/cas/config automatically.

Adding Modules

CAS modules may be specified under the dependencies block of the CAS subproject:

ndencies {
compile "org.apereo.cas:cas-server-webapp-tomcat:${project.'cas.version'}@war"
compile "org.apereo.cas:cas-server-some-module:${project.'cas.version'}"
...

Study material:

Build

To see what commands are available to the build script, run:

ild.sh help

To package the final web application, run:

ild.sh package

To update SNAPSHOT versions run:

ild.sh package --refresh-dependencies
Clear Gradle Cache

If you need to, on Linux/Unix systems, you can delete all the existing artifacts (artifacts and metadata) Gradle has downloaded using:

ly do this when absolutely necessary!
rf $HOME/.gradle/caches/

Same strategy applies to Windows too, provided you switch $HOME to its equivalent in the above command.

Build Tasks

To see what commands are available in the build, use:

radlew[.bat] tasks
Project Dependencies

To see where certain dependencies come from in the build:

ow the surrounding 2 before/after lines once a match is found
radlew[.bat] allDependencies | grep -A 2 -B 2 xyz

Or:

adlew[.bat] allDependenciesInsight --configuration [compile|runtime] --dependency xyz
Deployment
er.ssl.keyStore=file:/etc/cas/thekeystore
er.ssl.keyStorePassword=changeit
er.ssl.keyPassword=changeit

On a successful deployment via the following methods, CAS will be available at:

Executable WAR

Run the CAS web application as an executable WAR.

ild.sh run
Spring Boot

Run the CAS web application as an executable WAR via Spring Boot. This is most useful during development and testing.

ild.sh bootrun
Warning!

Be careful with this method of deployment. bootRun is not designed to work with already executable WAR artifacts such that CAS server web application. YMMV. Today, uses of this mode ONLY work when there is NO OTHER dependency added to the build script and the cas-server-webapp is the only present module. See this issue for more info.

External

Deploy resultant cas/build/libs/cas.war to a servlet container of choice.

Troubleshooting

You can also run the CAS server in DEBUG mode to step into the code via an IDE that is able to connect to the port 5005.

ild.sh debug

To setup a development environment for either eclipse or IDEA:

gradlew[.bat] eclipse
gradlew[.bat] idea

The above tasks help to setup a project for your development environment. If you find that something has gone wrong, you can always start anew by using the following:

gradlew[.bat] cleanEclipse
gradlew[.bat] cleanIdea
Explode WAR

You may explode/unzip the generated CAS web application if you wish to peek into the artifact to examine dependencies, configuration files and such that are merged as part of the overlay build process.

adlew[.bat] explodeWar
Command Line Shell

Invokes the CAS Command Line Shell. For a list of commands either use no arguments or use -h. To enter the interactive shell use -sh.

ild.sh cli

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.