Upgrade build to Gradle 7

Closes gh-572
This commit is contained in:
Steve Riesenberg
2022-03-30 14:39:01 -05:00
committed by Steve Riesenberg
parent 00faf44554
commit 72c2e15487
14 changed files with 260 additions and 188 deletions

View File

@@ -1,47 +1,13 @@
buildscript { plugins {
dependencies { id "io.spring.convention.root"
classpath 'io.spring.gradle:spring-build-conventions:0.0.38'
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
classpath 'io.spring.nohttp:nohttp-gradle:0.0.8'
}
repositories {
maven {
url = 'https://repo.spring.io/plugins-snapshot'
if (project.hasProperty('artifactoryUsername')) {
credentials {
username "$artifactoryUsername"
password "$artifactoryPassword"
}
}
}
maven { url 'https://plugins.gradle.org/m2/' }
}
} }
apply plugin: 'io.spring.nohttp' group = "org.springframework.security"
apply plugin: 'locks' description = "Spring Authorization Server"
apply plugin: 'io.spring.convention.root'
group = 'org.springframework.security' if (hasProperty("buildScan")) {
description = 'Spring Authorization Server' buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
ext.snapshotBuild = version.contains("SNAPSHOT") termsOfServiceAgree = "yes"
repositories {
mavenCentral()
}
dependencyManagementExport.projects = subprojects.findAll { !it.name.contains('-boot') }
subprojects {
plugins.withType(JavaPlugin) {
project.sourceCompatibility = "1.8"
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
} }
} }
nohttp {
allowlistFile = project.file("etc/nohttp/allowlist.lines")
}

View File

@@ -0,0 +1,25 @@
plugins {
id "java-platform"
}
javaPlatform {
allowDependencies()
}
dependencies {
api platform("org.springframework:spring-framework-bom:$springFrameworkVersion")
api platform("org.springframework.security:spring-security-bom:$springSecurityVersion")
api platform("org.junit:junit-bom:5.8.2")
api platform("com.fasterxml.jackson:jackson-bom:2.13.2")
constraints {
api "com.nimbusds:nimbus-jose-jwt:9.10.1"
api "javax.servlet:javax.servlet-api:4.0.1"
api "junit:junit:4.13.2"
api "org.assertj:assertj-core:3.22.0"
api "org.mockito:mockito-core:3.12.4"
api "com.squareup.okhttp3:mockwebserver:3.14.9"
api "com.squareup.okhttp3:okhttp:3.14.9"
api "com.jayway.jsonpath:json-path:2.7.0"
api "org.hsqldb:hsqldb:2.6.1"
}
}

View File

@@ -1,30 +1,30 @@
plugins { plugins {
id 'java' id "java"
} }
group = 'org.springframework.security' group = project.rootProject.group
version = '0.0.1-SNAPSHOT' version = project.rootProject.version
sourceCompatibility = '1.8' sourceCompatibility = "11"
repositories { repositories {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
implementation platform('org.springframework.boot:spring-boot-dependencies:2.6.2') implementation platform("org.springframework.boot:spring-boot-dependencies:2.5.12")
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation "org.springframework.boot:spring-boot-starter-web"
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' implementation "org.springframework.boot:spring-boot-starter-security"
implementation 'org.springframework.boot:spring-boot-starter-security' implementation "org.springframework.boot:spring-boot-starter-oauth2-client"
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server"
implementation 'org.springframework.boot:spring-boot-starter-web' implementation "org.springframework.boot:spring-boot-starter-data-jpa"
implementation 'org.springframework.security:spring-security-oauth2-authorization-server:0.2.1' implementation "org.thymeleaf.extras:thymeleaf-extras-springsecurity5"
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5' implementation project(":spring-security-oauth2-authorization-server")
runtimeOnly 'com.h2database:h2' runtimeOnly "com.h2database:h2"
testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation 'org.springframework.security:spring-security-test' testImplementation "org.springframework.security:spring-security-test"
} }
test { tasks.named("test") {
useJUnitPlatform() useJUnitPlatform()
} }

View File

@@ -0,0 +1,3 @@
plugins {
id "io.spring.convention.docs"
}

View File

@@ -1,5 +1,10 @@
version=0.3.0-SNAPSHOT version=0.3.0-SNAPSHOT
springBootVersion=2.5.10
org.gradle.jvmargs=-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError org.gradle.jvmargs=-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.parallel=true org.gradle.parallel=true
org.gradle.caching=true org.gradle.caching=true
springFrameworkVersion=5.3.19
springSecurityVersion=5.5.6
springJavaformatVersion=0.0.31
checkstyleToolVersion=8.34
nohttpCheckstyleVersion=0.0.10
jacocoToolVersion=0.8.7

View File

@@ -1,38 +0,0 @@
if (!project.hasProperty("springVersion")) {
ext.springVersion = "5.3.16"
}
if (!project.hasProperty("springSecurityVersion")) {
ext.springSecurityVersion = "5.5.5"
}
if (!project.hasProperty("reactorVersion")) {
ext.reactorVersion = "2020.0.16"
}
if (!project.hasProperty("locksDisabled")) {
dependencyLocking {
lockAllConfigurations()
}
}
dependencyManagement {
imports {
mavenBom "org.springframework:spring-framework-bom:$springVersion"
mavenBom "org.springframework.security:spring-security-bom:$springSecurityVersion"
mavenBom "io.projectreactor:reactor-bom:$reactorVersion"
mavenBom "com.fasterxml.jackson:jackson-bom:2.12.6"
}
dependencies {
dependency "com.nimbusds:nimbus-jose-jwt:9.10.1"
dependency "javax.servlet:javax.servlet-api:4.0.1"
dependency 'junit:junit:4.13.2'
dependency 'org.assertj:assertj-core:3.19.0'
dependency 'org.mockito:mockito-core:3.9.0'
dependency "com.squareup.okhttp3:mockwebserver:3.14.9"
dependency "com.squareup.okhttp3:okhttp:3.14.9"
dependency "com.jayway.jsonpath:json-path:2.5.0"
dependency "org.hsqldb:hsqldb:2.5.2"
}
}

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@@ -1,31 +1,35 @@
apply plugin: 'io.spring.convention.spring-module' plugins {
id "io.spring.convention.spring-module"
}
dependencies { dependencies {
compile 'org.springframework.security:spring-security-config' management platform(project(":spring-authorization-server-dependencies"))
compile 'org.springframework.security:spring-security-web'
compile 'org.springframework.security:spring-security-oauth2-core'
compile 'org.springframework.security:spring-security-oauth2-jose'
compile 'org.springframework.security:spring-security-oauth2-resource-server'
compile springCoreDependency
compile 'com.nimbusds:nimbus-jose-jwt'
compile 'com.fasterxml.jackson.core:jackson-databind'
optional 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310' api "org.springframework.security:spring-security-config"
optional 'org.springframework:spring-jdbc' api "org.springframework.security:spring-security-web"
api "org.springframework.security:spring-security-oauth2-core"
api "org.springframework.security:spring-security-oauth2-jose"
api "org.springframework.security:spring-security-oauth2-resource-server"
api("org.springframework:spring-core") {
exclude group: "commons-logging", module: "commons-logging"
}
api "com.nimbusds:nimbus-jose-jwt"
api "com.fasterxml.jackson.core:jackson-databind"
testCompile 'org.springframework.security:spring-security-test' optional "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
testCompile 'org.springframework:spring-webmvc' optional "org.springframework:spring-jdbc"
testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
testCompile 'org.mockito:mockito-core'
testCompile 'com.jayway.jsonpath:json-path'
testCompile 'com.squareup.okhttp3:mockwebserver'
testRuntime 'org.hsqldb:hsqldb' testImplementation "org.springframework.security:spring-security-test"
testImplementation "org.springframework:spring-webmvc"
testImplementation "org.junit.jupiter:junit-jupiter"
testImplementation "junit:junit"
testImplementation "org.junit.vintage:junit-vintage-engine"
testImplementation "org.assertj:assertj-core"
testImplementation "org.mockito:mockito-core"
testImplementation "com.jayway.jsonpath:json-path"
testImplementation "com.squareup.okhttp3:mockwebserver"
provided 'javax.servlet:javax.servlet-api' testRuntimeOnly "org.hsqldb:hsqldb"
}
provided "javax.servlet:javax.servlet-api"
jacoco {
toolVersion = '0.8.6'
} }

View File

@@ -1,12 +1,31 @@
apply plugin: 'io.spring.convention.spring-sample-boot' plugins {
id "org.springframework.boot" version "2.5.12"
id "io.spring.dependency-management" version "1.0.11.RELEASE"
id "java"
}
group = project.rootProject.group
version = project.rootProject.version
sourceCompatibility = "11"
repositories {
mavenCentral()
}
dependencies { dependencies {
compile 'org.springframework.boot:spring-boot-starter-web' implementation "org.springframework.boot:spring-boot-starter-web"
compile 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
compile 'org.springframework.boot:spring-boot-starter-security' implementation "org.springframework.boot:spring-boot-starter-security"
compile project(':spring-security-oauth2-authorization-server') implementation project(":spring-security-oauth2-authorization-server")
testCompile 'org.springframework.boot:spring-boot-starter-test' testImplementation "org.springframework.boot:spring-boot-starter-test"
testCompile 'org.springframework.security:spring-security-test' testImplementation "org.junit.jupiter:junit-jupiter"
testCompile 'net.sourceforge.htmlunit:htmlunit' testImplementation "junit:junit"
testImplementation "org.junit.vintage:junit-vintage-engine"
testImplementation "org.springframework.security:spring-security-test"
testImplementation "net.sourceforge.htmlunit:htmlunit"
}
tasks.named("test") {
useJUnitPlatform()
} }

View File

@@ -1,13 +1,32 @@
apply plugin: 'io.spring.convention.spring-sample-boot' plugins {
id "org.springframework.boot" version "2.5.12"
id "io.spring.dependency-management" version "1.0.11.RELEASE"
id "java"
}
group = project.rootProject.group
version = project.rootProject.version
sourceCompatibility = "11"
repositories {
mavenCentral()
}
dependencies { dependencies {
compile 'org.springframework.boot:spring-boot-starter-web' implementation "org.springframework.boot:spring-boot-starter-web"
compile 'org.springframework.boot:spring-boot-starter-security' implementation "org.springframework.boot:spring-boot-starter-security"
compile 'org.springframework.boot:spring-boot-starter-jdbc' implementation "org.springframework.boot:spring-boot-starter-jdbc"
compile project(':spring-security-oauth2-authorization-server') implementation project(":spring-security-oauth2-authorization-server")
runtimeOnly 'com.h2database:h2' runtimeOnly "com.h2database:h2"
testCompile 'org.springframework.boot:spring-boot-starter-test' testImplementation "org.springframework.boot:spring-boot-starter-test"
testCompile 'org.springframework.security:spring-security-test' testImplementation "org.junit.jupiter:junit-jupiter"
testCompile 'net.sourceforge.htmlunit:htmlunit' testImplementation "junit:junit"
testImplementation "org.junit.vintage:junit-vintage-engine"
testImplementation "org.springframework.security:spring-security-test"
testImplementation "net.sourceforge.htmlunit:htmlunit"
}
tasks.named("test") {
useJUnitPlatform()
} }

View File

@@ -1,19 +1,30 @@
apply plugin: 'io.spring.convention.spring-sample-boot' plugins {
id "org.springframework.boot" version "2.5.12"
id "io.spring.dependency-management" version "1.0.11.RELEASE"
id "java"
}
group = project.rootProject.group
version = project.rootProject.version
sourceCompatibility = "11"
repositories {
mavenCentral()
}
dependencies { dependencies {
compile 'org.springframework.boot:spring-boot-starter-web' implementation "org.springframework.boot:spring-boot-starter-web"
compile 'org.springframework.boot:spring-boot-starter-security' implementation "org.springframework.boot:spring-boot-starter-security"
compile 'org.springframework.boot:spring-boot-starter-oauth2-client' implementation "org.springframework.boot:spring-boot-starter-oauth2-client"
compile 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
compile 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5' implementation "org.springframework.boot:spring-boot-starter-jdbc"
compile 'org.webjars:webjars-locator-core' implementation "org.webjars:webjars-locator-core"
compile 'org.webjars:bootstrap:3.4.1' implementation "org.webjars:bootstrap:3.4.1"
compile 'org.webjars:jquery:3.4.1' implementation "org.webjars:jquery:3.4.1"
compile 'org.springframework.boot:spring-boot-starter-jdbc' implementation project(":spring-security-oauth2-authorization-server")
compile project(':spring-security-oauth2-authorization-server') runtimeOnly "com.h2database:h2"
runtimeOnly 'com.h2database:h2' }
testCompile 'org.springframework.boot:spring-boot-starter-test' tasks.named("test") {
testCompile 'org.springframework.security:spring-security-test' useJUnitPlatform()
testCompile 'net.sourceforge.htmlunit:htmlunit'
} }

View File

@@ -1,14 +1,30 @@
apply plugin: 'io.spring.convention.spring-sample-boot' plugins {
id "org.springframework.boot" version "2.5.12"
id "io.spring.dependency-management" version "1.0.11.RELEASE"
id "java"
}
group = project.rootProject.group
version = project.rootProject.version
sourceCompatibility = "11"
repositories {
mavenCentral()
}
dependencies { dependencies {
compile 'org.springframework.boot:spring-boot-starter-web' implementation "org.springframework.boot:spring-boot-starter-web"
compile 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
compile 'org.springframework.boot:spring-boot-starter-security' implementation "org.springframework.boot:spring-boot-starter-security"
compile 'org.springframework.boot:spring-boot-starter-oauth2-client' implementation "org.springframework.boot:spring-boot-starter-oauth2-client"
compile 'org.springframework:spring-webflux' implementation "org.springframework:spring-webflux"
compile 'io.projectreactor.netty:reactor-netty' implementation "io.projectreactor.netty:reactor-netty"
compile 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5' implementation "org.thymeleaf.extras:thymeleaf-extras-springsecurity5"
compile 'org.webjars:webjars-locator-core' implementation "org.webjars:webjars-locator-core"
compile 'org.webjars:bootstrap:3.4.1' implementation "org.webjars:bootstrap:3.4.1"
compile 'org.webjars:jquery:3.4.1' implementation "org.webjars:jquery:3.4.1"
}
tasks.named("test") {
useJUnitPlatform()
} }

View File

@@ -1,7 +1,23 @@
apply plugin: 'io.spring.convention.spring-sample-boot' plugins {
id "org.springframework.boot" version "2.5.12"
id "io.spring.dependency-management" version "1.0.11.RELEASE"
id "java"
}
group = project.rootProject.group
version = project.rootProject.version
sourceCompatibility = "11"
repositories {
mavenCentral()
}
dependencies { dependencies {
compile 'org.springframework.boot:spring-boot-starter-web' implementation "org.springframework.boot:spring-boot-starter-web"
compile 'org.springframework.boot:spring-boot-starter-security' implementation "org.springframework.boot:spring-boot-starter-security"
compile 'org.springframework.boot:spring-boot-starter-oauth2-resource-server' implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server"
}
tasks.named("test") {
useJUnitPlatform()
} }

View File

@@ -6,23 +6,49 @@ pluginManagement {
} }
plugins { plugins {
id "com.gradle.enterprise" version "3.8" id "com.gradle.enterprise" version "3.9"
id "io.spring.ge.conventions" version "0.0.9" id "io.spring.ge.conventions" version "0.0.9"
} }
rootProject.name = 'spring-authorization-server' dependencyResolutionManagement {
repositories {
FileTree buildFiles = fileTree(rootDir) { mavenCentral()
include '**/*.gradle' }
exclude 'build', '**/gradle', 'settings.gradle', 'buildSrc', '/build.gradle', '.*', 'out'
} }
buildFiles.each { File buildFile -> rootProject.name = "spring-authorization-server"
String projectName = buildFile.name.replace('.gradle', '');
String projectPath = ':' + projectName; def buildFiles = fileTree(rootDir) {
include projectPath def excludes = gradle.startParameter.projectProperties.get("excludeProjects")?.split(",")
def project = findProject("${projectPath}") include "**/*.gradle", "**/*.gradle.kts"
project.name = projectName exclude "build", "**/gradle", "settings.gradle", "buildSrc", "/build.gradle", ".*", "out"
project.projectDir = buildFile.parentFile if (excludes) {
project.buildFileName = buildFile.name exclude excludes
}
}
buildFiles.forEach { buildFile ->
def isDefaultName = buildFile.name == "build.gradle" || buildFile.name == "build.gradle.kts"
def isKotlin = buildFile.name.endsWith ".kts"
if (isDefaultName) {
def buildFilePath = buildFile.parentFile.absolutePath
def projectPath = buildFilePath.replace((String) rootDir.absolutePath, "").replace(File.separator, ":")
include projectPath
} else {
def projectName
if (isKotlin) {
projectName = buildFile.name.replace(".gradle.kts", "")
} else {
projectName = buildFile.name.replace(".gradle", "")
}
def projectPath = ":$projectName"
include projectPath
def project = findProject(projectPath)
project.name = projectName
project.projectDir = buildFile.parentFile
project.buildFileName = buildFile.name
}
} }