2010-07-26 21:16:39 -04:00
|
|
|
// CAS sample build file
|
|
|
|
|
2010-03-28 18:54:41 -04:00
|
|
|
apply plugin: 'war'
|
|
|
|
apply plugin: 'jetty'
|
2010-01-10 18:31:23 -05:00
|
|
|
|
2011-01-10 12:27:58 -05:00
|
|
|
def excludeModules = ['spring-security-acl', 'jsr250-api', 'ehcache', 'spring-jdbc', 'spring-tx']
|
|
|
|
|
2010-07-26 21:16:39 -04:00
|
|
|
configurations {
|
|
|
|
casServer
|
|
|
|
}
|
|
|
|
|
2011-01-10 12:27:58 -05:00
|
|
|
configurations {
|
|
|
|
excludeModules.each {name ->
|
|
|
|
runtime.exclude module: name
|
|
|
|
}
|
|
|
|
|
|
|
|
runtime.exclude group: 'org.aspectj'
|
|
|
|
}
|
|
|
|
|
2010-01-10 18:31:23 -05:00
|
|
|
dependencies {
|
2010-12-20 17:12:35 -05:00
|
|
|
casServer "org.jasig.cas:cas-server-webapp:3.4.3.1@war"
|
2010-07-26 21:16:39 -04:00
|
|
|
|
|
|
|
runtime project(':spring-security-web'),
|
|
|
|
project(':spring-security-cas'),
|
2010-01-10 18:31:23 -05:00
|
|
|
project(':spring-security-config'),
|
2010-07-26 21:16:39 -04:00
|
|
|
"org.slf4j:jcl-over-slf4j:$slf4jVersion",
|
|
|
|
"ch.qos.logback:logback-classic:$logbackVersion"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
def keystore = "$rootDir/samples/certificates/server.jks"
|
|
|
|
|
2011-01-10 12:27:58 -05:00
|
|
|
[jettyRun, jettyRunWar]*.configure {
|
2011-04-03 22:41:26 -04:00
|
|
|
contextPath = "/cas-sample"
|
2010-07-26 21:16:39 -04:00
|
|
|
def httpConnector = new org.mortbay.jetty.nio.SelectChannelConnector();
|
|
|
|
httpConnector.port = 8080
|
|
|
|
httpConnector.confidentialPort = 8443
|
|
|
|
def httpsConnector = new org.mortbay.jetty.security.SslSocketConnector();
|
|
|
|
httpsConnector.port = 8443
|
|
|
|
httpsConnector.keystore = httpsConnector.truststore = keystore
|
|
|
|
httpsConnector.keyPassword = httpsConnector.trustPassword = 'password'
|
|
|
|
|
|
|
|
connectors = [httpConnector, httpsConnector]
|
|
|
|
}
|
|
|
|
|
2010-08-22 17:31:01 -04:00
|
|
|
|
2010-07-26 21:16:39 -04:00
|
|
|
task casServer (type: org.gradle.api.plugins.jetty.JettyRunWar) {
|
|
|
|
contextPath = "/cas"
|
|
|
|
connectors = [new org.mortbay.jetty.security.SslSocketConnector()]
|
|
|
|
connectors[0].port = 9443
|
|
|
|
connectors[0].keystore = connectors[0].truststore = keystore
|
|
|
|
connectors[0].keyPassword = connectors[0].trustPassword = 'password'
|
|
|
|
connectors[0].wantClientAuth = true
|
|
|
|
connectors[0].needClientAuth = false
|
|
|
|
webApp = configurations.casServer.resolve().toArray()[0]
|
|
|
|
doFirst() {
|
|
|
|
System.setProperty('javax.net.ssl.trustStore', keystore)
|
|
|
|
System.setProperty('javax.net.ssl.trustStorePassword', 'password')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-10 12:27:58 -05:00
|
|
|
task cas (dependsOn: [jettyRunWar, casServer]) {
|
2010-12-20 17:12:35 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
gradle.taskGraph.whenReady {graph ->
|
|
|
|
if (graph.hasTask(cas)) {
|
2011-01-10 12:27:58 -05:00
|
|
|
jettyRunWar.dependsOn(casServer)
|
2010-12-20 17:12:35 -05:00
|
|
|
casServer.daemon = true
|
|
|
|
}
|
2010-07-26 21:16:39 -04:00
|
|
|
}
|