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

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