apply plugin: 'groovy' apply plugin: 'war' //apply plugin: 'org.akhikhl.gretty' //apply plugin: 'ru.shadam.gretty' //apply from: 'https://raw.github.com/akhikhl/gretty/master/pluginScripts/gretty.plugin' apply from: 'https://raw.github.com/saladinkzn/gretty/master/pluginScripts/gretty.plugin' import org.akhikhl.gretty.AppStopTask farm { //Works //webapp "org.jasig.cas:cas-server-webapp:$cas_version", contextPath: '/cas', inplace: true, classPath: ["${project.projectDir}/etc/jars/cas-server-support-rest-4.2.1.jar"] webapp "org.jasig.cas:cas-server-webapp:$cas_version", contextPath: '/cas', inplace: true, dependencies: [ "org.jasig.cas:cas-server-support-rest:4.2.1" ] //webapp "org.jasig.cas:cas-server-webapp:$cas_version", contextPath: '/cas', inplace: true, overlay: "org.jasig.cas:cas-server-support-rest:$cas_version" webapp "org.jasig.cas:cas-management-webapp:$cas_version", contextPath: '/cas-services', inplace: true //webapp ':cas' webapp ':protected-web-app' afterEvaluate { project.tasks.farmAfterIntegrationTest.dependsOn 'build' } } buildscript { repositories { jcenter() maven { url 'http://oss.sonatype.org/content/repositories/releases/' } maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' } } dependencies { //classpath "org.akhikhl.gretty:gretty:$gretty_version" //classpath 'ru.shadam.gretty:gretty:+' classpath "ru.shadam.gretty:gretty:$gretty_version" } } repositories { jcenter() // enable this to use snapshot versions of Gretty: maven { url 'http://oss.sonatype.org/content/repositories/releases/' } maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' } } test { include '**/*Spec*.*' } task integrationTest(type: Test, dependsOn: 'test') { outputs.upToDateWhen { false } include '**/*Spec*.*' // specific to concrete test harness doFirst { systemProperty 'geb.build.reportsDir', reporting.file('geb') } } // This empty AppStopTask task makes Jetty shutdown if any of the tests fail. // This may be a bug in Gretty (https://github.com/akhikhl/gretty/issues/214) // or Gradle (https://issues.gradle.org/browse/GRADLE-2263) task ('shutdownHook', type: AppStopTask) << { } // afterEvaluate makes sure the empty shutdownHook task runs when the test task exits // from execution. project.afterEvaluate { project.tasks.test.finalizedBy shutdownHook } dependencies { // specific to concrete test harness testCompile "org.codehaus.groovy:groovy-all:$groovy_version" testCompile "org.spockframework:spock-core:$spock_version" testCompile "org.gebish:geb-spock:$gebVersion" testCompile "org.seleniumhq.selenium:selenium-support:$seleniumVersion" testCompile "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion" testCompile "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion" testCompile "org.seleniumhq.selenium:selenium-ie-driver:$seleniumVersion" testCompile "org.seleniumhq.selenium:selenium-safari-driver:$seleniumVersion" testCompile "org.seleniumhq.selenium:selenium-htmlunit-driver:$seleniumVersion" testCompile "org.codehaus.groovy.modules.http-builder:http-builder:$httpClient" } gretty { systemProperty 'service.registry.config.location', './etc/services' systemProperty 'server.name', 'https://localhost:8443' systemProperty 'cas.host', 'https://localhost:8443' //systemProperty 'server.name', 'http://localhost:8080' //systemProperty 'cas.host', 'http://localhost:8080' systemProperty 'server.prefix', '${server.name}/cas' systemProperty 'cas.prefix', '${cas.host}/cas' systemProperty 'cas.securityContext.casProcessingFilterEntryPoint.loginUrl', '${cas.prefix}/login' systemProperty 'cas.securityContext.ticketValidator.casServerUrlPrefix', '${cas.prefix}' systemProperty 'cas-management.host', 'https://localhost:8443' //systemProperty 'cas-management.host', 'http://localhost:8080' systemProperty 'cas-management.prefix', '${cas.host}/cas-services' systemProperty 'cas-management.securityContext.serviceProperties.service', '${cas-management.prefix}/callback' systemProperty 'cas-management.securityContext.serviceProperties.adminRoles', 'ROLE_ADMIN' systemProperty 'pac4j.callback.defaultUrl', '/manage.html' systemProperty 'log4j.configurationFile', './etc/jetty/log4j2.xml' systemProperty 'accept.authn.users', 'casuser::Mellon,scott::password,bob::password2' systemProperty 'tgc.encryption.key', '1PbwSbnHeinpkZOSZjuSJ8yYpUrInm5aaV18J2Ar4rM' systemProperty 'tgc.signing.key', 'szxK-5_eJjs-aUj-64MpUZ-GPPzGLhYPLGl0wrYjYNVAGva2P0lLe6UGKGM7k8dWxsOVGutZWgvmY3l5oVPO3w' systemProperty 'tgc.name', 'TGC' systemProperty 'create.sso.renewed.authn', 'true' systemProperty 'user.details.file.location', 'file:./etc/user-details.properties' systemProperty 'javax.net.ssl.trustStore', "${project.projectDir}/etc/jetty/keystore" systemProperty 'javax.net.ssl.trustStorePassword', 'changeit' sslKeyStorePath = "${project.projectDir}/etc/jetty/keystore" sslKeyStorePassword = 'changeit' integrationTestTask = 'integrationTest' httpsEnabled = true httpEnabled = true }