From eee07a840f3fd50432bf92cb4ab018d319457751 Mon Sep 17 00:00:00 2001 From: jnizet Date: Mon, 24 Sep 2018 18:53:46 +0200 Subject: [PATCH] Move away from deprecated Gradle configurations Closes gh-14593 --- .../spring-boot-gradle-plugin/build.gradle | 12 ++++++------ .../gradle/managing-dependencies/dependencies.gradle | 4 ++-- .../gradle/packaging/boot-jar-requires-unpack.gradle | 2 +- .../gradle/packaging/war-container-dependency.gradle | 2 +- .../plugin/KotlinPluginActionIntegrationTests.java | 5 ++--- ...rorWhenVersionlessDependencyFailsToResolve.gradle | 2 +- ...aLocationsConfiguredWhenProcessorIsPresent.gradle | 2 +- ...ts-kotlinVersionMatchesKotlinPluginVersion.gradle | 2 +- ...esAreAnalyzedWhenDependencyResolutionFails.gradle | 2 +- ...rationTests-duplicatesAreHandledGracefully.gradle | 2 +- 10 files changed, 17 insertions(+), 18 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle index 10341c0d21..0e2c39d5c0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle @@ -21,12 +21,12 @@ repositories { } dependencies { - compile localGroovy() - compile gradleApi() - compile fileTree(dir: 'target/dependencies/compile', include: '*.jar') - testCompile gradleTestKit() - testCompile 'org.apache.commons:commons-compress:1.13' - testCompile fileTree(dir: 'target/dependencies/test', include: '*.jar') + implementation localGroovy() + implementation gradleApi() + implementation fileTree(dir: 'target/dependencies/compile', include: '*.jar') + testImplementation gradleTestKit() + testImplementation 'org.apache.commons:commons-compress:1.13' + testImplementation fileTree(dir: 'target/dependencies/test', include: '*.jar') } jar { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/dependencies.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/dependencies.gradle index ecbf6ffedc..7ee3a5726a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/dependencies.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/dependencies.gradle @@ -13,7 +13,7 @@ apply plugin: 'io.spring.dependency-management' // tag::dependencies[] dependencies { - compile 'org.springframework.boot:spring-boot-starter-web' - compile 'org.springframework.boot:spring-boot-starter-data-jpa' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' } // end::dependencies[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-requires-unpack.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-requires-unpack.gradle index e7806982a7..168eeaff79 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-requires-unpack.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-requires-unpack.gradle @@ -12,7 +12,7 @@ repositories { } dependencies { - runtime 'org.jruby:jruby-complete:1.7.25' + runtimeOnly 'org.jruby:jruby-complete:1.7.25' } bootJar { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/war-container-dependency.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/war-container-dependency.gradle index 9f8c91b64e..70712eac26 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/war-container-dependency.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/war-container-dependency.gradle @@ -13,7 +13,7 @@ apply plugin: 'io.spring.dependency-management' // tag::dependencies[] dependencies { - compile 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-web' providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat' } // end::dependencies[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests.java index fcb5356d3a..c824e843dc 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests.java @@ -44,9 +44,8 @@ public class KotlinPluginActionIntegrationTests { @Test public void kotlinVersionMatchesKotlinPluginVersion() { - String output = this.gradleBuild - .build("kotlinVersion", "dependencies", "--configuration", "compile") - .getOutput(); + String output = this.gradleBuild.build("kotlinVersion", "dependencies", + "--configuration", "compileClasspath").getOutput(); assertThat(output).contains("Kotlin version: 1.2.10"); assertThat(output) .containsPattern("org.jetbrains.kotlin:kotlin-stdlib-jdk8:* -> 1.2.10"); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/DependencyManagementPluginActionIntegrationTests-helpfulErrorWhenVersionlessDependencyFailsToResolve.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/DependencyManagementPluginActionIntegrationTests-helpfulErrorWhenVersionlessDependencyFailsToResolve.gradle index 2aeaadbc4a..f80a0b67a8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/DependencyManagementPluginActionIntegrationTests-helpfulErrorWhenVersionlessDependencyFailsToResolve.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/DependencyManagementPluginActionIntegrationTests-helpfulErrorWhenVersionlessDependencyFailsToResolve.gradle @@ -12,5 +12,5 @@ repositories { } dependencies { - compile 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-web' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-additionalMetadataLocationsConfiguredWhenProcessorIsPresent.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-additionalMetadataLocationsConfiguredWhenProcessorIsPresent.gradle index 5fc8fda755..b53e1a8094 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-additionalMetadataLocationsConfiguredWhenProcessorIsPresent.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/JavaPluginActionIntegrationTests-additionalMetadataLocationsConfiguredWhenProcessorIsPresent.gradle @@ -12,7 +12,7 @@ repositories { } dependencies { - def configurationName = GradleVersion.current().compareTo(GradleVersion.version("4.6")) >= 0 ? 'annotationProcessor': 'compile' + def configurationName = GradleVersion.current().compareTo(GradleVersion.version("4.6")) >= 0 ? 'annotationProcessor': 'implementation' add(configurationName, [name: 'spring-boot-configuration-processor-1.2.3']) } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinVersionMatchesKotlinPluginVersion.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinVersionMatchesKotlinPluginVersion.gradle index 561ae1d224..5bdc4b09a6 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinVersionMatchesKotlinPluginVersion.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests-kotlinVersionMatchesKotlinPluginVersion.gradle @@ -28,7 +28,7 @@ repositories { } dependencies { - compile 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' + implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' } task kotlinVersion { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootPluginIntegrationTests-unresolvedDependenciesAreAnalyzedWhenDependencyResolutionFails.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootPluginIntegrationTests-unresolvedDependenciesAreAnalyzedWhenDependencyResolutionFails.gradle index 32ec8c58b1..459fdbc6a3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootPluginIntegrationTests-unresolvedDependenciesAreAnalyzedWhenDependencyResolutionFails.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootPluginIntegrationTests-unresolvedDependenciesAreAnalyzedWhenDependencyResolutionFails.gradle @@ -12,5 +12,5 @@ repositories { } dependencies { - compile 'org.springframework.boot:spring-boot-starter' + implementation 'org.springframework.boot:spring-boot-starter' } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-duplicatesAreHandledGracefully.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-duplicatesAreHandledGracefully.gradle index 603d6e841b..62cae4d47f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-duplicatesAreHandledGracefully.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-duplicatesAreHandledGracefully.gradle @@ -26,6 +26,6 @@ repositories { } dependencies { - compile "org.apache.commons:commons-lang3:3.6" + implementation "org.apache.commons:commons-lang3:3.6" provided "org.apache.commons:commons-lang3:3.6" }