build.gradle 2.2 KB

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