build.gradle 2.5 KB

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