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.
- CAS 5.0.x
- JDK 1.8+
The etc directory contains the configuration files that are copied to /etc/cas/config automatically.
CAS modules may be specified under the dependencies block of the CAS subproject:
dependencies {
compile "org.apereo.cas:cas-server-webapp:${project.'cas.version'}@war"
compile "org.apereo.cas:cas-server-some-module:${project.'cas.version'}"
...
}Study material:
- https://docs.gradle.org/current/userguide/artifact_dependencies_tutorial.html
- https://docs.gradle.org/current/userguide/dependency_management.html
./gradlew[.bat] clean buildOr faster builds on subsequent attempts once modules/dependencies are resolved:
./gradlew[.bat] clean build --parallel --offlineIf you are on a SNAPSHOT version, you can force redownloads of modules/dependencies:
./gradlew[.bat] clean build --parallel --refresh-dependenciesIf you need to, on Linux/Unix systems, you can delete all the existing artifacts (artifacts and metadata) Gradle has downloaded using:
# Only do this when absolutely necessary!
rm -rf $HOME/.gradle/caches/Same strategy applies to Windows too, provided you switch $HOME to its equivalent in the above command.
To see what commands are available in the build, use:
./gradlew[.bat] tasksTo see where certain dependencies come from in the build:
# Show the surrounding 2 before/after lines once a match is found
./gradlew[.bat] allDependencies | grep -A 2 -B 2 xyzOr:
./gradlew[.bat] allDependenciesInsight --configuration [compile|runtime] --dependency xyz- Create a keystore file
thekeystoreunder/etc/cason Linux. Usec:/etc/cason Windows. - Use the password
changeitfor both the keystore and the key/certificate entries. - Ensure the keystore is loaded up with keys and certificates of the server.
On a successful deployment via the following methods, CAS will be available at:
http://cas.server.name:8080/cashttps://cas.server.name:8443/cas
Run the CAS web application as an executable WAR.
java -jar cas/build/libs/cas.warOr via Gradle:
./gradlew[.bat] runitRun the CAS web application as an executable WAR via Spring Boot. This is most useful during development and testing.
./gradlew[.bat] bootrunBe 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 and this issue for more info.
Deploy resultant cas/build/libs/cas.war to a servlet container of choice.