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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 "org.jasig.cas:cas-server-webapp:4.0.7@war"
  6. compile slf4jDependencies
  7. runtime 'org.aspectj:aspectjrt'
  8. runtime 'org.aspectj:aspectjtools'
  9. runtime 'org.aspectj:aspectjweaver'
  10. }
  11. project.tasks.withType(org.gradle.api.tasks.bundling.War) { war ->
  12. war.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
  13. project.tasks.war.doFirst {
  14. war.classpath = war.classpath.filter { !it.name.endsWith(".war") }
  15. war.project.configurations.runtime.each {
  16. if (it.name.endsWith(".war")) {
  17. def fileList = war.project.zipTree(it)
  18. war.from fileList
  19. }
  20. }
  21. }
  22. }
  23. project.tasks.withType(org.akhikhl.gretty.StartBaseTask).all { task ->
  24. task.doFirst {
  25. def destinationDir = project.file("$buildDir/inplaceWebapp")
  26. project.configurations.runtime.each { dependency ->
  27. if (dependency.name.endsWith(".war")) {
  28. def warTree = project.zipTree(dependency)
  29. project.copy {
  30. from warTree
  31. into destinationDir
  32. eachFile {
  33. if (it.relativePath.getFile(destinationDir).exists()) {
  34. it.exclude()
  35. }
  36. }
  37. }
  38. }
  39. }
  40. }
  41. }
  42. gretty {
  43. contextPath = '/cas'
  44. httpsEnabled = true
  45. httpPort = 9090
  46. httpsPort = 9443
  47. sslKeyStorePath = keystore
  48. sslKeyStorePassword = password
  49. jvmArgs = ["-Djavax.net.ssl.trustStore=${keystore}", "-Djavax.net.ssl.trustStorePassword=${password}"]
  50. logbackConfigFile = "src/main/resources/logback.xml"
  51. }