Coder Social home page Coder Social logo

jimmytheneutrino / cas-gradle-overlay-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apereo/cas-gradle-overlay-template

0.0 2.0 0.0 158 KB

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

Home Page: https://apereo.github.io/cas

License: Apache License 2.0

Java 100.00%

cas-gradle-overlay-template's Introduction

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

  • CAS 5.1.x

Requirements

  • JDK 1.8+

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:

dependencies {
    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

./gradlew[.bat] clean build

Faster builds on subsequent attempts once modules/dependencies are resolved:

./gradlew[.bat] clean build --parallel --offline

Note: A number of options can be made default in gradle.properties. For example, --parallel can be defaulted via org.gradle.parallel=true.

Updating SNAPSHOT Builds

If you are on a SNAPSHOT version, you can force re-downloads of modules/dependencies:

 ./gradlew[.bat] clean build --parallel --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:

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

Build Tasks

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

 ./gradlew[.bat] tasks

Project Dependencies

To 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 xyz

Or:

./gradlew[.bat] allDependenciesInsight --configuration [compile|runtime] --dependency xyz

Deployment

  • Create a keystore file thekeystore under /etc/cas on Linux. Use c:/etc/cas on Windows.
  • Use the password changeit for both the keystore and the key/certificate entries.
  • Ensure the keystore is loaded up with keys and certificates of the server.
    • Add the following to ./etc/cas/config/cas.properties
    server.ssl.keyStore=file:/etc/cas/thekeystore
    server.ssl.keyStorePassword=changeit
    server.ssl.keyPassword=changeit
    

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

  • http://cas.server.name:8080/cas
  • https://cas.server.name:8443/cas

Executable WAR

Run the CAS web application as an executable WAR.

java -jar cas/build/libs/cas.war

Or via Gradle:

# You need to check your project path into cas/build.gradle for this command
./gradlew[.bat] run

Spring Boot

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

./gradlew[.bat] 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 and 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.

./gradlew[.bat] 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.

./gradlew[.bat] explodeWar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.