Commit e2c3b103 authored by Misagh Moayyed's avatar Misagh Moayyed

fixed merged conflicts

parents 5d214ee9 cf8a33bb
......@@ -6,10 +6,11 @@ Generic CAS WAR overlay to exercise the latest versions of CAS. This overlay cou
# Versions
```xml
<cas.version>5.1.x</cas.version>
<cas.version>5.2.x</cas.version>
```
# Requirements
* JDK 1.8+
# Configuration
......@@ -68,16 +69,18 @@ Be careful with this method of deployment. `bootRun` is not designed to work wit
## Spring Boot App Server Selection
There is an app.server property in the pom.xml that can be used to select a spring boot application server.
It defaults to "-tomcat" but "-jetty" and "-undertow" are supported.
It can also be set to an empty value (nothing) if you want to deploy CAS to an external application server of your choice and you don't want the spring boot libraries included.
There is an app.server property in the `pom.xml` that can be used to select a spring boot application server.
It defaults to `-tomcat` but `-jetty` and `-undertow` are supported.
It can also be set to an empty value (nothing) if you want to deploy CAS to an external application server of your choice.
```xml
<app.server>-tomcat<app.server>
```
## Windows Build
If you are building on windows, try build.cmd instead of build.sh. Arguments are similar but for usage, run:
If you are building on windows, try `build.cmd` instead of `build.sh`. Arguments are similar but for usage, run:
```
build.cmd help
......@@ -86,3 +89,12 @@ build.cmd help
## External
Deploy resultant `target/cas.war` to a servlet container of choice.
## 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`.
```bash
./build.sh command
```
\ No newline at end of file
......@@ -23,8 +23,10 @@
@if "%1" == "bootrun" call:bootrun %2 %3 %4
@if "%1" == "debug" call:debug %2 %3 %4
@if "%1" == "run" call:run %2 %3 %4
@if "%1" == "runalone" call:runalone %2 %3 %4
@if "%1" == "help" call:help
@if "%1" == "gencert" call:gencert
@if "%1" == "command" call:command
@rem function section starts here
@goto:eof
......@@ -38,7 +40,7 @@
@goto:eof
:help
@echo "Usage: build.bat [copy|clean|package|run|debug|bootrun|gencert] [optional extra args for maven]"
@echo "Usage: build.bat [copy|clean|package|run|debug|bootrun|gencert|command] [optional extra args for maven]"
@echo "To get started on a clean system, run "build.bat copy" and "build.bat gencert", then "build.bat run"
@echo "Note that using the copy or gencert arguments will create and/or overwrite the %CAS_DIR% which is outside this project"
@goto:eof
......@@ -66,6 +68,10 @@
call:package %1 %2 %3 & java %JAVA_ARGS% -jar target/cas.war
@goto:eof
:runalone
call:package %1 %2 %3 & target/cas.war
@goto:eof
:gencert
where /q keytool
if ERRORLEVEL 1 (
......@@ -80,3 +86,11 @@
keytool -exportcert -alias cas -storepass changeit -keystore %CAS_DIR%\thekeystore -file %CAS_DIR%\cas.cer
)
@goto:eof
:command
for /f %%i in ('call %MAVEN_CMD% -q --non-recursive "-Dexec.executable=cmd" "-Dexec.args=/C echo ${cas.version}" "org.codehaus.mojo:exec-maven-plugin:1.3.1:exec"') do set CAS_VERSION=%%i
@set CAS_VERSION=%CAS_VERSION: =%
@set COMMAND_FILE=target\cas-server-support-shell-%CAS_VERSION%.jar
if not exist %COMMAND_FILE% powershell.exe -Command (new-object System.Net.WebClient).DownloadFile('http://repo1.maven.org/maven2/org/apereo/cas/cas-server-support-shell/%CAS_VERSION%/cas-server-support-shell-%CAS_VERSION%.jar','%COMMAND_FILE%')
call java %JAVA_ARGS% -jar %COMMAND_FILE% %1 %2 %3
@goto:eof
......@@ -14,10 +14,12 @@ function help() {
echo " copy: Copy config from ./etc/cas/config to /etc/cas/config"
echo " clean: Clean Maven build directory"
echo " package: Clean and build CAS war, also call copy"
echo " run: Build and run CAS.war via spring boot (java -jar target/cas.war)"
echo " run: Build and run cas.war via spring boot (java -jar target/cas.war)"
echo " runalone: Build and run cas.war on its own (target/cas.war)"
echo " debug: Run CAS.war and listen for Java debugger on port 5000"
echo " bootrun: Run with maven spring boot plugin, doesn't work with multiple dependencies"
echo " gencert: Create keystore with SSL certificate in location where CAS looks by default"
echo " command: Run the CAS command line shell and pass commands"
}
function clean() {
......@@ -41,6 +43,10 @@ function run() {
package && java -jar target/cas.war
}
function runalone() {
package && chmod +x target/cas.war && target/cas.war
}
function gencert() {
if [[ ! -d /etc/cas ]] ; then
copy
......@@ -58,6 +64,16 @@ function gencert() {
keytool -exportcert -alias cas -storepass changeit -keystore /etc/cas/thekeystore -file /etc/cas/cas.cer
}
function command() {
CAS_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${cas.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec 2>/dev/null)
COMMAND_FILE="./target/cas-server-support-shell-${CAS_VERSION}.jar"
if [ ! -f "$COMMAND_FILE" ]; then
package
wget -q http://repo1.maven.org/maven2/org/apereo/cas/cas-server-support-shell/${CAS_VERSION}/cas-server-support-shell-${CAS_VERSION}.jar -P ./target
fi
java -jar target/cas-server-support-shell-${CAS_VERSION}.jar "$@"
}
if [ $# -eq 0 ]; then
echo -e "No commands provided. Defaulting to [run]\n"
run
......@@ -87,9 +103,16 @@ case "$1" in
"run")
run "$@"
;;
"runalone")
runalone "$@"
;;
"gencert")
gencert "$@"
;;
"command")
shift
command "$@"
;;
*)
help
;;
......
......@@ -24,9 +24,18 @@
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${springboot.version}</version>
<configuration>
<mainClass>org.springframework.boot.loader.WarLauncher</mainClass>
<mainClass>${mainClassName}</mainClass>
<addResources>true</addResources>
<executable>${isExecutable}</executable>
<layout>WAR</layout>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
......@@ -38,8 +47,7 @@
<recompressZippedFiles>false</recompressZippedFiles>
<archive>
<compress>false</compress>
<manifestFile>${project.build.directory}/war/work/org.apereo.cas/cas-server-webapp${app.server}/META-INF/MANIFEST.MF
</manifestFile>
<manifestFile>${manifestFileToUse}</manifestFile>
</archive>
<overlays>
<overlay>
......@@ -69,10 +77,15 @@
</dependencies>
<properties>
<cas.version>5.1.5</cas.version>
<springboot.version>1.5.3.RELEASE</springboot.version>
<cas.version>5.2.0-RC4</cas.version>
<springboot.version>1.5.7.RELEASE</springboot.version>
<!-- app.server could be -jetty, -undertow, -tomcat, or blank if you plan to provide appserver -->
<app.server>-tomcat</app.server>
<mainClassName>org.springframework.boot.loader.WarLauncher</mainClassName>
<isExecutable>false</isExecutable>
<manifestFileToUse>${project.build.directory}/war/work/org.apereo.cas/cas-server-webapp${app.server}/META-INF/MANIFEST.MF</manifestFileToUse>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
......@@ -103,13 +116,42 @@
<id>shibboleth-releases</id>
<url>https://build.shibboleth.net/nexus/content/repositories/releases</url>
</repository>
<repository>
<id>spring-milestones</id>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>
<profiles>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<id>exec</id>
<properties>
<mainClassName>org.apereo.cas.web.CasWebApplication</mainClassName>
<isExecutable>true</isExecutable>
<manifestFileToUse></manifestFileToUse>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.soebes.maven.plugins</groupId>
<artifactId>echo-maven-plugin</artifactId>
<version>0.3.0</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>echo</goal>
</goals>
</execution>
</executions>
<configuration>
<echos>
<echo>Executable profile to make the generated CAS web application executable.</echo></echos>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<activation>
<activeByDefault>false</activeByDefault>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment