build.gradle 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. buildscript {
  2. dependencies {
  3. classpath "io.spring.javaformat:spring-javaformat-gradle-plugin:$springJavaformatVersion"
  4. classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
  5. classpath 'io.spring.nohttp:nohttp-gradle:0.0.5.RELEASE'
  6. classpath "io.freefair.gradle:aspectj-plugin:5.0.1"
  7. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
  8. }
  9. repositories {
  10. maven { url 'https://repo.spring.io/plugins-snapshot' }
  11. maven { url 'https://plugins.gradle.org/m2/' }
  12. }
  13. }
  14. apply plugin: 'io.spring.nohttp'
  15. apply plugin: 'locks'
  16. apply plugin: 'io.spring.convention.root'
  17. apply plugin: 'org.jetbrains.kotlin.jvm'
  18. apply plugin: 'org.springframework.security.update-dependencies'
  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. repositories {
  25. mavenCentral()
  26. }
  27. updateDependenciesSettings {
  28. gitHub {
  29. organization = "rwinch"
  30. repository = "spring-security"
  31. }
  32. addFiles({
  33. return [
  34. project.file("buildSrc/src/main/java/io/spring/gradle/convention/AsciidoctorConventionPlugin.java"),
  35. project.file("buildSrc/src/main/groovy/io/spring/gradle/convention/CheckstylePlugin.groovy")
  36. ]
  37. })
  38. dependencyExcludes {
  39. majorVersionBump()
  40. alphaBetaVersions()
  41. releaseCandidatesVersions()
  42. milestoneVersions()
  43. snapshotVersions()
  44. }
  45. }
  46. subprojects {
  47. plugins.withType(JavaPlugin) {
  48. project.sourceCompatibility='1.8'
  49. }
  50. tasks.withType(JavaCompile) {
  51. options.encoding = "UTF-8"
  52. }
  53. }
  54. allprojects {
  55. if (!['spring-security-bom', 'spring-security-docs'].contains(project.name)) {
  56. apply plugin: 'io.spring.javaformat'
  57. apply plugin: 'checkstyle'
  58. pluginManager.withPlugin("io.spring.convention.checkstyle", { plugin ->
  59. configure(plugin) {
  60. dependencies {
  61. checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:$springJavaformatVersion"
  62. }
  63. checkstyle {
  64. toolVersion = '8.34'
  65. }
  66. }
  67. })
  68. if (project.name.contains('sample')) {
  69. tasks.whenTaskAdded { task ->
  70. if (task.name.contains('format') || task.name.contains('checkFormat') || task.name.contains("checkstyle")) {
  71. task.enabled = false
  72. }
  73. }
  74. }
  75. }
  76. }
  77. if (hasProperty('buildScan')) {
  78. buildScan {
  79. termsOfServiceUrl = 'https://gradle.com/terms-of-service'
  80. termsOfServiceAgree = 'yes'
  81. }
  82. }
  83. nohttp {
  84. allowlistFile = project.file("etc/nohttp/allowlist.lines")
  85. source.exclude "buildSrc/build/**"
  86. }