build.gradle 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. group = 'org.springframework.security'
  19. description = 'Spring Security'
  20. ext.snapshotBuild = version.contains("SNAPSHOT")
  21. ext.releaseBuild = version.contains("SNAPSHOT")
  22. ext.milestoneBuild = !(snapshotBuild || releaseBuild)
  23. repositories {
  24. mavenCentral()
  25. }
  26. subprojects {
  27. plugins.withType(JavaPlugin) {
  28. project.sourceCompatibility='1.8'
  29. }
  30. tasks.withType(JavaCompile) {
  31. options.encoding = "UTF-8"
  32. }
  33. }
  34. allprojects {
  35. if (!['spring-security-bom', 'spring-security-docs'].contains(project.name)) {
  36. apply plugin: 'io.spring.javaformat'
  37. apply plugin: 'checkstyle'
  38. pluginManager.withPlugin("io.spring.convention.checkstyle", { plugin ->
  39. configure(plugin) {
  40. dependencies {
  41. checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:$springJavaformatVersion"
  42. }
  43. checkstyle {
  44. toolVersion = '8.34'
  45. }
  46. }
  47. })
  48. if (project.name.contains('sample')) {
  49. tasks.whenTaskAdded { task ->
  50. if (task.name.contains('format') || task.name.contains('checkFormat') || task.name.contains("checkstyle")) {
  51. task.enabled = false
  52. }
  53. }
  54. }
  55. }
  56. }
  57. if (hasProperty('buildScan')) {
  58. buildScan {
  59. termsOfServiceUrl = 'https://gradle.com/terms-of-service'
  60. termsOfServiceAgree = 'yes'
  61. }
  62. }
  63. nohttp {
  64. allowlistFile = project.file("etc/nohttp/allowlist.lines")
  65. source.exclude "buildSrc/build/**"
  66. }