spring-security-samples-xml-casserver.gradle 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import org.apache.tools.ant.filters.ReplaceTokens
  2. apply plugin: 'io.spring.convention.spring-sample-war'
  3. def keystore = "$rootDir/samples/certificates/server.jks"
  4. def password = 'password'
  5. dependencies {
  6. compile "org.jasig.cas:cas-server-webapp:4.0.0@war"
  7. compile slf4jDependencies
  8. }
  9. project.tasks.withType(org.gradle.api.tasks.bundling.War) { war ->
  10. war.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
  11. project.tasks.war.doFirst {
  12. war.classpath = war.classpath.filter { !it.name.endsWith(".war") }
  13. war.project.configurations.runtime.each {
  14. if (it.name.endsWith(".war")) {
  15. def fileList = war.project.zipTree(it)
  16. war.from fileList
  17. }
  18. }
  19. }
  20. }
  21. project.tasks.withType(org.akhikhl.gretty.StartBaseTask).all { task ->
  22. task.doFirst {
  23. def destinationDir = project.file("$buildDir/inplaceWebapp")
  24. project.configurations.runtime.each { dependency ->
  25. if (dependency.name.endsWith(".war")) {
  26. def warTree = project.zipTree(dependency)
  27. project.copy {
  28. from warTree
  29. into destinationDir
  30. eachFile {
  31. if (it.relativePath.getFile(destinationDir).exists()) {
  32. it.exclude()
  33. }
  34. }
  35. }
  36. }
  37. }
  38. }
  39. }
  40. gretty {
  41. contextPath = '/cas'
  42. httpsEnabled = true
  43. httpPort = 9090
  44. httpsPort = 9443
  45. sslKeyStorePath = keystore
  46. sslKeyStorePassword = password
  47. jvmArgs = ["-Djavax.net.ssl.trustStore=${keystore}", "-Djavax.net.ssl.trustStorePassword=${password}"]
  48. }