spring-security-samples-xml-cassample.gradle 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. apply plugin: 'io.spring.convention.spring-sample-war'
  2. def keystore = "$rootDir/samples/certificates/server.jks"
  3. def password = 'password'
  4. sourceSets {
  5. test.resources.exclude 'GebConfig.groovy'
  6. integrationTest.groovy.srcDir file('src/integration-test/groovy')
  7. }
  8. dependencies {
  9. compile project(':spring-security-cas')
  10. compile project(':spring-security-core')
  11. compile 'org.jasig.cas.client:cas-client-core'
  12. providedCompile 'javax.servlet:javax.servlet-api'
  13. runtime project(':spring-security-config')
  14. runtime project(':spring-security-web')
  15. runtime 'ch.qos.logback:logback-classic'
  16. runtime 'net.sf.ehcache:ehcache'
  17. runtime 'org.slf4j:jcl-over-slf4j'
  18. runtime 'org.springframework:spring-context-support'
  19. integrationTestCompile project(':spring-security-cas')
  20. integrationTestCompile gebDependencies
  21. integrationTestCompile seleniumDependencies
  22. integrationTestCompile spockDependencies
  23. integrationTestCompile 'org.codehaus.groovy:groovy'
  24. integrationTestCompile 'org.eclipse.jetty:jetty-server'
  25. integrationTestCompile 'org.eclipse.jetty:jetty-servlet'
  26. integrationTestCompile 'org.slf4j:jcl-over-slf4j'
  27. }
  28. integrationTest {
  29. dependsOn { casServer().tasks.appBeforeIntegrationTest }
  30. doFirst {
  31. def casServiceHost = 'localhost:' + gretty.httpsPort
  32. def casServerHost = 'localhost:' + casServer().gretty.httpsPort
  33. systemProperties['cas.server.host'] = casServerHost
  34. systemProperties['cas.service.host'] = casServiceHost
  35. systemProperties['geb.build.baseUrl'] = 'https://'+casServiceHost+'/cas-sample/'
  36. systemProperties['geb.build.reportsDir'] = 'build/geb-reports'
  37. systemProperties['jar.path'] = jar.archivePath
  38. systemProperties['javax.net.ssl.trustStore'] = keystore
  39. systemProperties['javax.net.ssl.trustStorePassword'] = password
  40. }
  41. finalizedBy { casServer().tasks.appAfterIntegrationTest }
  42. }
  43. prepareAppServerForIntegrationTests {
  44. dependsOn { casServer().tasks.appBeforeIntegrationTest }
  45. doLast {
  46. def casServiceHost = 'localhost:' + project.gretty.httpsPort
  47. def casServerHost = 'localhost:' + casServer().gretty.httpsPort
  48. gretty.jvmArgs += ["-Dcas.server.host=${casServerHost}", "-Dcas.service.host=${casServiceHost}"]
  49. }
  50. }
  51. gretty {
  52. contextPath = '/cas-sample/'
  53. httpsEnabled = true
  54. httpsPort = 8443
  55. sslKeyStorePath = keystore
  56. sslKeyStorePassword = password
  57. jvmArgs = ["-Djavax.net.ssl.trustStore=${keystore}", "-Djavax.net.ssl.trustStorePassword=${password}"]
  58. }
  59. def casServer() {
  60. project(':spring-security-samples-xml-casserver')
  61. }