build.gradle 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. buildscript {
  2. dependencies {
  3. classpath 'io.spring.gradle:spring-build-conventions:0.0.33.RELEASE'
  4. classpath "io.spring.javaformat:spring-javaformat-gradle-plugin:$springJavaformatVersion"
  5. classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
  6. classpath 'io.spring.nohttp:nohttp-gradle:0.0.5.RELEASE'
  7. classpath "io.freefair.gradle:aspectj-plugin:5.0.1"
  8. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
  9. }
  10. repositories {
  11. maven { url 'https://repo.spring.io/plugins-snapshot' }
  12. maven { url 'https://plugins.gradle.org/m2/' }
  13. }
  14. }
  15. apply plugin: 'io.spring.nohttp'
  16. apply plugin: 'locks'
  17. apply plugin: 'io.spring.convention.root'
  18. apply plugin: 'org.jetbrains.kotlin.jvm'
  19. group = 'org.springframework.security'
  20. description = 'Spring Security'
  21. ext.snapshotBuild = version.contains("SNAPSHOT")
  22. ext.releaseBuild = version.contains("SNAPSHOT")
  23. ext.milestoneBuild = !(snapshotBuild || releaseBuild)
  24. dependencyManagementExport.projects = subprojects.findAll { !it.name.contains('-boot') }
  25. repositories {
  26. mavenCentral()
  27. }
  28. subprojects {
  29. plugins.withType(JavaPlugin) {
  30. project.sourceCompatibility='1.8'
  31. }
  32. tasks.withType(JavaCompile) {
  33. options.encoding = "UTF-8"
  34. }
  35. }
  36. allprojects {
  37. if (!['spring-security-bom', 'spring-security-docs'].contains(project.name)) {
  38. apply plugin: 'io.spring.javaformat'
  39. apply plugin: 'checkstyle'
  40. pluginManager.withPlugin("io.spring.convention.checkstyle", { plugin ->
  41. configure(plugin) {
  42. dependencies {
  43. checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:$springJavaformatVersion"
  44. }
  45. checkstyle {
  46. toolVersion = '8.34'
  47. }
  48. }
  49. })
  50. if (project.name.contains('sample')) {
  51. tasks.whenTaskAdded { task ->
  52. if (task.name.contains('format') || task.name.contains('checkFormat') || task.name.contains("checkstyle")) {
  53. task.enabled = false
  54. }
  55. }
  56. }
  57. }
  58. }
  59. if (hasProperty('buildScan')) {
  60. buildScan {
  61. termsOfServiceUrl = 'https://gradle.com/terms-of-service'
  62. termsOfServiceAgree = 'yes'
  63. }
  64. }
  65. nohttp {
  66. allowlistFile = project.file("etc/nohttp/allowlist.lines")
  67. }