Fix Gradle 9.0 deprecations
This commit addresses several build warnings and errors to prepare for Gradle 9.0 and resolve static analysis issues. Closes: gh-18472 Signed-off-by: Pavel Vassiliev <paulvas@gmail.com> Signed-off-by: Pavel Vassiliev <paulvas@gmail.com>
This commit is contained in:
committed by
Rob Winch
parent
13f6286e04
commit
641d8a362b
@@ -2,12 +2,12 @@ apply plugin: 'io.spring.convention.spring-module'
|
|||||||
apply plugin: 'io.freefair.aspectj'
|
apply plugin: 'io.freefair.aspectj'
|
||||||
|
|
||||||
compileAspectj {
|
compileAspectj {
|
||||||
sourceCompatibility "17"
|
sourceCompatibility = "17"
|
||||||
targetCompatibility "17"
|
targetCompatibility = "17"
|
||||||
}
|
}
|
||||||
compileTestAspectj {
|
compileTestAspectj {
|
||||||
sourceCompatibility "17"
|
sourceCompatibility = "17"
|
||||||
targetCompatibility "17"
|
targetCompatibility = "17"
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
+3
-5
@@ -10,7 +10,7 @@ buildscript {
|
|||||||
classpath libs.com.netflix.nebula.nebula.project.plugin
|
classpath libs.com.netflix.nebula.nebula.project.plugin
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
maven { url 'https://plugins.gradle.org/m2/' }
|
maven { url='https://plugins.gradle.org/m2/' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ ext.milestoneBuild = !(snapshotBuild || releaseBuild)
|
|||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url "https://repo.spring.io/milestone" }
|
maven { url = "https://repo.spring.io/milestone" }
|
||||||
}
|
}
|
||||||
|
|
||||||
springRelease {
|
springRelease {
|
||||||
@@ -76,8 +76,7 @@ allprojects {
|
|||||||
apply plugin: 'io.spring.javaformat'
|
apply plugin: 'io.spring.javaformat'
|
||||||
apply plugin: 'checkstyle'
|
apply plugin: 'checkstyle'
|
||||||
|
|
||||||
pluginManager.withPlugin("io.spring.convention.checkstyle", { plugin ->
|
pluginManager.withPlugin("io.spring.convention.checkstyle") {
|
||||||
configure(plugin) {
|
|
||||||
dependencies {
|
dependencies {
|
||||||
checkstyle libs.io.spring.javaformat.spring.javaformat.checkstyle
|
checkstyle libs.io.spring.javaformat.spring.javaformat.checkstyle
|
||||||
}
|
}
|
||||||
@@ -85,7 +84,6 @@ allprojects {
|
|||||||
toolVersion = '8.34'
|
toolVersion = '8.34'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
if (project.name.contains('sample')) {
|
if (project.name.contains('sample')) {
|
||||||
tasks.whenTaskAdded { task ->
|
tasks.whenTaskAdded { task ->
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ java {
|
|||||||
repositories {
|
repositories {
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url 'https://repo.spring.io/snapshot' }
|
maven { url = 'https://repo.spring.io/snapshot' }
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
|||||||
@@ -31,12 +31,12 @@ public class DocsPlugin implements Plugin<Project> {
|
|||||||
into 'api'
|
into 'api'
|
||||||
}
|
}
|
||||||
into 'docs'
|
into 'docs'
|
||||||
duplicatesStrategy 'exclude'
|
duplicatesStrategy = 'exclude'
|
||||||
}
|
}
|
||||||
|
|
||||||
Task docs = project.tasks.create("docs") {
|
Task docs = project.tasks.create("docs") {
|
||||||
group = 'Documentation'
|
group = 'Documentation'
|
||||||
description 'An aggregator task to generate all the documentation'
|
description = 'An aggregator task to generate all the documentation'
|
||||||
dependsOn docsZip
|
dependsOn docsZip
|
||||||
}
|
}
|
||||||
project.tasks.assemble.dependsOn docs
|
project.tasks.assemble.dependsOn docs
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class IntegrationTestPlugin implements Plugin<Project> {
|
|||||||
project.plugins.withType(IdeaPlugin) {
|
project.plugins.withType(IdeaPlugin) {
|
||||||
project.idea {
|
project.idea {
|
||||||
module {
|
module {
|
||||||
testSourceDirs += project.file('src/integration-test/java')
|
testSources.from(project.file('src/integration-test/java'))
|
||||||
scopes.TEST.plus += [ project.configurations.integrationTestCompileClasspath ]
|
scopes.TEST.plus += [ project.configurations.integrationTestCompileClasspath ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@ public class IntegrationTestPlugin implements Plugin<Project> {
|
|||||||
project.plugins.withType(IdeaPlugin) {
|
project.plugins.withType(IdeaPlugin) {
|
||||||
project.idea {
|
project.idea {
|
||||||
module {
|
module {
|
||||||
testSourceDirs += project.file('src/integration-test/groovy')
|
testSources.from(project.file('src/integration-test/groovy'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.gradle.api.Action;
|
|||||||
import org.gradle.api.JavaVersion
|
import org.gradle.api.JavaVersion
|
||||||
import org.gradle.api.Plugin;
|
import org.gradle.api.Plugin;
|
||||||
import org.gradle.api.Project;
|
import org.gradle.api.Project;
|
||||||
import org.gradle.api.plugins.JavaPluginConvention;
|
import org.gradle.api.plugins.JavaPluginExtension;
|
||||||
import org.gradle.api.tasks.SourceSet;
|
import org.gradle.api.tasks.SourceSet;
|
||||||
import org.gradle.api.tasks.javadoc.Javadoc;
|
import org.gradle.api.tasks.javadoc.Javadoc;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -71,7 +71,7 @@ public class JavadocApiPlugin implements Plugin<Project> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
api.setMaxMemory("1024m");
|
api.setMaxMemory("1024m");
|
||||||
api.setDestinationDir(new File(project.getBuildDir(), "api"));
|
api.setDestinationDir(project.layout.getBuildDirectory().dir("api").get().getAsFile());
|
||||||
|
|
||||||
project.getPluginManager().apply("io.spring.convention.javadoc-options");
|
project.getPluginManager().apply("io.spring.convention.javadoc-options");
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ public class JavadocApiPlugin implements Plugin<Project> {
|
|||||||
public void execute(SpringModulePlugin plugin) {
|
public void execute(SpringModulePlugin plugin) {
|
||||||
logger.info("Added sources for {}", project);
|
logger.info("Added sources for {}", project);
|
||||||
|
|
||||||
JavaPluginConvention java = project.getConvention().getPlugin(JavaPluginConvention.class);
|
JavaPluginExtension java = project.getExtensions().getByType(JavaPluginExtension.class);
|
||||||
SourceSet mainSourceSet = java.getSourceSets().getByName("main");
|
SourceSet mainSourceSet = java.getSourceSets().getByName("main");
|
||||||
|
|
||||||
api.setSource(api.getSource().plus(mainSourceSet.getAllJava()));
|
api.setSource(api.getSource().plus(mainSourceSet.getAllJava()));
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class SchemaZipPlugin implements Plugin<Project> {
|
|||||||
throw new IllegalStateException("Could not find schema file for resource name " + schemaResourceName + " in src/main/resources")
|
throw new IllegalStateException("Could not find schema file for resource name " + schemaResourceName + " in src/main/resources")
|
||||||
}
|
}
|
||||||
schemaZip.into (shortName) {
|
schemaZip.into (shortName) {
|
||||||
duplicatesStrategy 'exclude'
|
duplicatesStrategy = 'exclude'
|
||||||
from xsdFile.path
|
from xsdFile.path
|
||||||
}
|
}
|
||||||
versionlessXsd.getInputFiles().from(xsdFile.path)
|
versionlessXsd.getInputFiles().from(xsdFile.path)
|
||||||
|
|||||||
@@ -144,14 +144,14 @@ tasks.named('processResources', ProcessResources).configure {
|
|||||||
into 'org/springframework/security/config/'
|
into 'org/springframework/security/config/'
|
||||||
}
|
}
|
||||||
from(rncToXsd) {
|
from(rncToXsd) {
|
||||||
duplicatesStrategy DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
into 'org/springframework/security/config/'
|
into 'org/springframework/security/config/'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named('sourcesJar', Jar).configure {
|
tasks.named('sourcesJar', Jar).configure {
|
||||||
from(rncToXsd) {
|
from(rncToXsd) {
|
||||||
duplicatesStrategy DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
into 'org/springframework/security/config/'
|
into 'org/springframework/security/config/'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,12 +92,12 @@ com-thaiopensource-trag = "com.thaiopensource:trang:20091111"
|
|||||||
net-sourceforge-saxon-saxon = "net.sourceforge.saxon:saxon:9.1.0.8"
|
net-sourceforge-saxon-saxon = "net.sourceforge.saxon:saxon:9.1.0.8"
|
||||||
org-yaml-snakeyaml = "org.yaml:snakeyaml:1.33"
|
org-yaml-snakeyaml = "org.yaml:snakeyaml:1.33"
|
||||||
org-apache-commons-commons-io = "org.apache.commons:commons-io:1.3.2"
|
org-apache-commons-commons-io = "org.apache.commons:commons-io:1.3.2"
|
||||||
io-github-gradle-nexus-publish-plugin = "io.github.gradle-nexus:publish-plugin:1.3.0"
|
io-github-gradle-nexus-publish-plugin = "io.github.gradle-nexus:publish-plugin:2.0.0"
|
||||||
org-gretty-gretty = "org.gretty:gretty:4.1.10"
|
org-gretty-gretty = "org.gretty:gretty:4.1.10"
|
||||||
com-github-ben-manes-gradle-versions-plugin = "com.github.ben-manes:gradle-versions-plugin:0.52.0"
|
com-github-ben-manes-gradle-versions-plugin = "com.github.ben-manes:gradle-versions-plugin:0.52.0"
|
||||||
com-github-spullara-mustache-java-compiler = "com.github.spullara.mustache.java:compiler:0.9.14"
|
com-github-spullara-mustache-java-compiler = "com.github.spullara.mustache.java:compiler:0.9.14"
|
||||||
org-hidetake-gradle-ssh-plugin = "org.hidetake:gradle-ssh-plugin:2.10.1"
|
org-hidetake-gradle-ssh-plugin = "org.hidetake:gradle-ssh-plugin:2.10.1"
|
||||||
org-jfrog-buildinfo-build-info-extractor-gradle = "org.jfrog.buildinfo:build-info-extractor-gradle:4.34.2"
|
org-jfrog-buildinfo-build-info-extractor-gradle = "org.jfrog.buildinfo:build-info-extractor-gradle:6.0.4"
|
||||||
org-sonarsource-scanner-gradle-sonarqube-gradle-plugin = "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8.0.1969"
|
org-sonarsource-scanner-gradle-sonarqube-gradle-plugin = "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8.0.1969"
|
||||||
org-instancio-instancio-junit = "org.instancio:instancio-junit:3.7.1"
|
org-instancio-instancio-junit = "org.instancio:instancio-junit:3.7.1"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ plugins {
|
|||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url "https://repo.spring.io/snapshot" }
|
maven { url = "https://repo.spring.io/snapshot" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user