diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/publishing.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/publishing.adoc index 328b82fdf18..a8bd6e60f54 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/publishing.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/publishing.adoc @@ -25,7 +25,7 @@ include::../gradle/publishing/maven-publish.gradle.kts[tags=publishing] [[publishing-your-application-maven]] === Publishing with the Maven Plugin -WARNING: The `maven` plugin has been deprecated in Gradle 6 and has been removed in Gradle 7. +WARNING: Due to its deprecation in Gradle 6, this plugin's support for publishing with Gradle's `maven` plugin is deprecated and will be removed in a future release. Please use the `maven-publish` plugin instead. When the {maven-plugin}[`maven` plugin] is applied, an `Upload` task for the `bootArchives` configuration named `uploadBootArchives` is automatically created. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/reacting.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/reacting.adoc index 7fc27f43fbe..b4d58e2453f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/reacting.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/reacting.adoc @@ -66,4 +66,7 @@ When Gradle's {application-plugin}[`application` plugin] is applied to a project [[reacting-to-other-plugins-maven]] === Reacting to the Maven plugin +WARNING: Support for reacting to Gradle's `maven` plugin is deprecated and will be removed in a future release. +Please use the `maven-publish` plugin instead. + When Gradle's {maven-plugin}[`maven` plugin] is applied to a project, the Spring Boot plugin will configure the `uploadBootArchives` `Upload` task to ensure that no dependencies are declared in the pom that it generates. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/MavenPluginAction.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/MavenPluginAction.java index 94132da2cea..11ff1835110 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/MavenPluginAction.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/MavenPluginAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,14 +19,17 @@ package org.springframework.boot.gradle.plugin; import org.gradle.api.Action; import org.gradle.api.Plugin; import org.gradle.api.Project; +import org.gradle.api.publish.maven.plugins.MavenPublishPlugin; import org.gradle.api.tasks.Upload; /** * {@link Action} that is executed in response to the * {@link org.gradle.api.plugins.MavenPlugin} being applied. * + * @deprecated since 2.5.0 in favor of using the {@link MavenPublishPlugin} * @author Andy Wilkinson */ +@Deprecated final class MavenPluginAction implements PluginApplicationAction { private final String uploadTaskName; @@ -36,7 +39,6 @@ final class MavenPluginAction implements PluginApplicationAction { } @Override - @SuppressWarnings("deprecation") public Class> getPluginClass() { return org.gradle.api.plugins.MavenPlugin.class; } @@ -50,7 +52,6 @@ final class MavenPluginAction implements PluginApplicationAction { }); } - @SuppressWarnings("deprecation") private void clearConfigurationMappings(Upload upload) { upload.getRepositories().withType(org.gradle.api.artifacts.maven.MavenResolver.class, (resolver) -> resolver.getPom().getScopeMappings().getMappings().clear()); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SpringBootPlugin.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SpringBootPlugin.java index 26178f9c0b2..fbcd2941bb6 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SpringBootPlugin.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SpringBootPlugin.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -116,6 +116,7 @@ public class SpringBootPlugin implements Plugin { private void registerPluginActions(Project project, Configuration bootArchives) { SinglePublishedArtifact singlePublishedArtifact = new SinglePublishedArtifact(bootArchives.getArtifacts()); + @SuppressWarnings("deprecation") List actions = Arrays.asList(new JavaPluginAction(singlePublishedArtifact), new WarPluginAction(singlePublishedArtifact), new MavenPluginAction(bootArchives.getUploadTaskName()), new DependencyManagementPluginAction(), new ApplicationPluginAction(), new KotlinPluginAction());