spring-security/samples/cas/cas.gradle

71 lines
2.0 KiB
Groovy
Raw Normal View History

// CAS sample build file
2010-03-28 18:54:41 -04:00
apply plugin: 'war'
apply plugin: 'jetty'
def excludeModules = ['spring-security-acl', 'jsr250-api', 'ehcache', 'spring-jdbc', 'spring-tx']
configurations {
casServer
}
configurations {
excludeModules.each {name ->
runtime.exclude module: name
}
runtime.exclude group: 'org.aspectj'
}
dependencies {
casServer "org.jasig.cas:cas-server-webapp:3.4.3.1@war"
runtime project(':spring-security-web'),
project(':spring-security-cas'),
project(':spring-security-config'),
"org.slf4j:jcl-over-slf4j:$slf4jVersion",
"ch.qos.logback:logback-classic:$logbackVersion"
}
def keystore = "$rootDir/samples/certificates/server.jks"
[jettyRun, jettyRunWar]*.configure {
contextPath = "/cas-sample"
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]
}
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')
}
}
task cas (dependsOn: [jettyRunWar, casServer]) {
}
gradle.taskGraph.whenReady {graph ->
if (graph.hasTask(cas)) {
jettyRunWar.dependsOn(casServer)
casServer.daemon = true
}
}