Don't apply configuration-properties from auto-configuration plugin

Update the auto-configuration gradle plugin so that the
configuration-properties plugin is not longer automatically applied.
This  allows us to have auto-configuration modules that don't ship
configuration properties.

Closes gh-35028
This commit is contained in:
Phillip Webb 2023-04-14 14:55:03 -07:00
parent 148c632299
commit 1849b82334
4 changed files with 3 additions and 4 deletions

View File

@ -28,7 +28,6 @@ import org.gradle.api.plugins.JavaPluginExtension;
import org.gradle.api.tasks.SourceSet;
import org.springframework.boot.build.DeployedPlugin;
import org.springframework.boot.build.context.properties.ConfigurationPropertiesPlugin;
/**
* {@link Plugin} for projects that define auto-configuration. When applied, the plugin
@ -36,7 +35,6 @@ import org.springframework.boot.build.context.properties.ConfigurationProperties
* {@link JavaPlugin} by:
*
* <ul>
* <li>Applying the {@link ConfigurationPropertiesPlugin}.
* <li>Adding a dependency on the auto-configuration annotation processor.
* <li>Defining a task that produces metadata describing the auto-configuration. The
* metadata is made available as an artifact in the
@ -56,7 +54,6 @@ public class AutoConfigurationPlugin implements Plugin<Project> {
public void apply(Project project) {
project.getPlugins().apply(DeployedPlugin.class);
project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> {
project.getPlugins().apply(ConfigurationPropertiesPlugin.class);
Configuration annotationProcessors = project.getConfigurations()
.getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME);
annotationProcessors.getDependencies()

View File

@ -2,6 +2,7 @@ plugins {
id "java-library"
id "org.asciidoctor.jvm.convert"
id "org.springframework.boot.auto-configuration"
id "org.springframework.boot.configuration-properties"
id "org.springframework.boot.conventions"
id "org.springframework.boot.deployed"
id "org.springframework.boot.optional-dependencies"
@ -18,7 +19,6 @@ dependencies {
asciidoctorExtensions("io.spring.asciidoctor:spring-asciidoctor-extensions-section-ids")
api(project(":spring-boot-project:spring-boot-actuator"))
api(project(":spring-boot-project:spring-boot"))
api(project(":spring-boot-project:spring-boot-autoconfigure"))

View File

@ -2,6 +2,7 @@ plugins {
id "java-library"
id "org.jetbrains.kotlin.jvm"
id "org.springframework.boot.auto-configuration"
id "org.springframework.boot.configuration-properties"
id "org.springframework.boot.conventions"
id "org.springframework.boot.deployed"
id "org.springframework.boot.optional-dependencies"

View File

@ -1,6 +1,7 @@
plugins {
id "java-library"
id "org.springframework.boot.auto-configuration"
id "org.springframework.boot.configuration-properties"
id "org.springframework.boot.conventions"
id "org.springframework.boot.deployed"
id "org.springframework.boot.integration-test"