build.gradle 2.0 KB

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