Skip to content

Commit f533ba7

Browse files
committed
Start splitting up spring-boot
1 parent e2682d6 commit f533ba7

File tree

412 files changed

+494
-315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

412 files changed

+494
-315
lines changed

buildSrc/src/main/java/org/springframework/boot/build/ConventionsPlugin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -50,6 +50,7 @@ public void apply(Project project) {
5050
new KotlinConventions().apply(project);
5151
new WarConventions().apply(project);
5252
new EclipseConventions().apply(project);
53+
new TestFixturesConventions().apply(project);
5354
RepositoryTransformersExtension.apply(project);
5455
}
5556

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright 2012-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.boot.build;
18+
19+
import org.gradle.api.Project;
20+
import org.gradle.api.artifacts.ConfigurationContainer;
21+
import org.gradle.api.component.AdhocComponentWithVariants;
22+
import org.gradle.api.plugins.JavaTestFixturesPlugin;
23+
24+
/**
25+
* Conventions that are applied in the presence of the {@link JavaTestFixturesPlugin}.
26+
* When the plugin is applied:
27+
*
28+
* <ul>
29+
* <li>Publishing of the test fixtures is disabled.
30+
* </ul>
31+
*
32+
* @author Andy Wilkinson
33+
*/
34+
class TestFixturesConventions {
35+
36+
void apply(Project project) {
37+
project.getPlugins().withType(JavaTestFixturesPlugin.class, (testFixtures) -> disablePublishing(project));
38+
}
39+
40+
private void disablePublishing(Project project) {
41+
ConfigurationContainer configurations = project.getConfigurations();
42+
AdhocComponentWithVariants javaComponent = (AdhocComponentWithVariants) project.getComponents()
43+
.getByName("java");
44+
javaComponent.withVariantsFromConfiguration(configurations.getByName("testFixturesApiElements"),
45+
(variant) -> variant.skip());
46+
javaComponent.withVariantsFromConfiguration(configurations.getByName("testFixturesRuntimeElements"),
47+
(variant) -> variant.skip());
48+
}
49+
50+
}

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ include "spring-boot-project:spring-boot"
6060
include "spring-boot-project:spring-boot-autoconfigure"
6161
include "spring-boot-project:spring-boot-actuator"
6262
include "spring-boot-project:spring-boot-actuator-autoconfigure"
63+
include "spring-boot-project:spring-boot-all"
6364
include "spring-boot-project:spring-boot-docker-compose"
6465
include "spring-boot-project:spring-boot-devtools"
6566
include "spring-boot-project:spring-boot-docs"

spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description = "Spring Boot Actuator AutoConfigure"
1111

1212
dependencies {
1313
api(project(":spring-boot-project:spring-boot-actuator"))
14-
api(project(":spring-boot-project:spring-boot"))
14+
api(project(":spring-boot-project:spring-boot-all"))
1515
api(project(":spring-boot-project:spring-boot-autoconfigure"))
1616

1717
implementation("com.fasterxml.jackson.core:jackson-databind")

spring-boot-project/spring-boot-actuator/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
description = "Spring Boot Actuator"
1010

1111
dependencies {
12-
api(project(":spring-boot-project:spring-boot"))
12+
api(project(":spring-boot-project:spring-boot-all"))
1313

1414
dockerTestImplementation(project(":spring-boot-project:spring-boot-autoconfigure"))
1515
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
plugins {
2+
id "dev.adamko.dokkatoo-html"
3+
id "java-library"
4+
id "org.jetbrains.kotlin.jvm"
5+
id "org.springframework.boot.deployed"
6+
id "org.springframework.boot.optional-dependencies"
7+
}
8+
9+
description = "Spring Boot All"
10+
11+
def tomcatConfigProperties = layout.buildDirectory.dir("tomcat-config-properties")
12+
13+
configurations {
14+
tomcatDistribution
15+
}
16+
17+
dependencies {
18+
api(project(":spring-boot-project:spring-boot"))
19+
api("org.springframework:spring-core")
20+
api("org.springframework:spring-context")
21+
22+
optional("ch.qos.logback:logback-classic")
23+
optional("com.clickhouse:clickhouse-jdbc")
24+
optional("com.fasterxml.jackson.core:jackson-databind")
25+
optional("com.h2database:h2")
26+
optional("com.google.code.gson:gson")
27+
optional("com.mchange:c3p0")
28+
optional("com.oracle.database.jdbc:ucp11")
29+
optional("com.oracle.database.jdbc:ojdbc11")
30+
optional("com.samskivert:jmustache")
31+
optional("com.zaxxer:HikariCP")
32+
optional("io.netty:netty-tcnative-boringssl-static")
33+
optional("io.projectreactor:reactor-tools")
34+
optional("io.projectreactor.netty:reactor-netty-http")
35+
optional("io.r2dbc:r2dbc-pool")
36+
optional("io.rsocket:rsocket-core")
37+
optional("io.rsocket:rsocket-transport-netty")
38+
optional("io.undertow:undertow-servlet")
39+
optional("jakarta.jms:jakarta.jms-api")
40+
optional("jakarta.persistence:jakarta.persistence-api")
41+
optional("jakarta.servlet:jakarta.servlet-api")
42+
optional("jakarta.transaction:jakarta.transaction-api")
43+
optional("junit:junit")
44+
optional("org.apache.commons:commons-dbcp2") {
45+
exclude(group: "commons-logging", module: "commons-logging")
46+
}
47+
optional("org.apache.httpcomponents.client5:httpclient5")
48+
optional("org.apache.logging.log4j:log4j-api")
49+
optional("org.apache.logging.log4j:log4j-core")
50+
optional("org.apache.logging.log4j:log4j-jul")
51+
optional("org.apache.tomcat.embed:tomcat-embed-core")
52+
optional("org.apache.tomcat.embed:tomcat-embed-jasper")
53+
optional("org.apache.tomcat:tomcat-jdbc")
54+
optional("org.assertj:assertj-core")
55+
optional("org.apache.groovy:groovy")
56+
optional("org.apache.groovy:groovy-xml")
57+
optional("org.crac:crac")
58+
optional("org.eclipse.jetty:jetty-alpn-conscrypt-server")
59+
optional("org.eclipse.jetty:jetty-client")
60+
optional("org.eclipse.jetty:jetty-util")
61+
optional("org.eclipse.jetty.ee10:jetty-ee10-servlets")
62+
optional("org.eclipse.jetty.ee10:jetty-ee10-webapp")
63+
optional("org.eclipse.jetty.http2:jetty-http2-server")
64+
optional("org.flywaydb:flyway-core")
65+
optional("org.hamcrest:hamcrest-library")
66+
optional("org.hibernate.orm:hibernate-core")
67+
optional("org.hibernate.validator:hibernate-validator")
68+
optional("org.jooq:jooq") {
69+
exclude(group: "javax.xml.bind", module: "jaxb-api")
70+
}
71+
optional("org.liquibase:liquibase-core") {
72+
exclude(group: "javax.xml.bind", module: "jaxb-api")
73+
}
74+
optional("org.messaginghub:pooled-jms") {
75+
exclude group: "org.apache.geronimo.specs", module: "geronimo-jms_2.0_spec"
76+
}
77+
optional("org.postgresql:postgresql")
78+
optional("org.slf4j:jul-to-slf4j")
79+
optional("org.slf4j:slf4j-api")
80+
optional("org.springframework:spring-messaging")
81+
optional("org.springframework:spring-orm")
82+
optional("org.springframework:spring-jms")
83+
optional("org.springframework:spring-oxm")
84+
optional("org.springframework:spring-r2dbc")
85+
optional("org.springframework:spring-test")
86+
optional("org.springframework:spring-web")
87+
optional("org.springframework:spring-webflux")
88+
optional("org.springframework:spring-webmvc")
89+
optional("org.springframework.security:spring-security-web")
90+
optional("org.springframework.ws:spring-ws-core") {
91+
exclude group: "com.sun.mail", module: "jakarta.mail"
92+
exclude group: "jakarta.platform", module: "jakarta.jakartaee-api"
93+
exclude group: "org.eclipse.jetty", module: "jetty-server"
94+
exclude group: "org.eclipse.jetty", module: "jetty-servlet"
95+
exclude group: "jakarta.mail", module: "jakarta.mail-api"
96+
}
97+
optional("org.vibur:vibur-dbcp")
98+
optional("org.yaml:snakeyaml")
99+
optional("org.jetbrains.kotlin:kotlin-reflect")
100+
optional("org.jetbrains.kotlin:kotlin-stdlib")
101+
optional("software.amazon.jdbc:aws-advanced-jdbc-wrapper") {
102+
exclude(group: "commons-logging", module: "commons-logging")
103+
}
104+
105+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
106+
testImplementation(testFixtures(project(":spring-boot-project:spring-boot")))
107+
testImplementation("org.springframework:spring-core-test")
108+
testImplementation("com.ibm.db2:jcc")
109+
testImplementation("com.jayway.jsonpath:json-path")
110+
testImplementation("com.microsoft.sqlserver:mssql-jdbc")
111+
testImplementation("com.mysql:mysql-connector-j")
112+
testImplementation("com.sun.xml.messaging.saaj:saaj-impl")
113+
testImplementation("io.projectreactor:reactor-test")
114+
testImplementation("io.r2dbc:r2dbc-h2")
115+
testImplementation("jakarta.inject:jakarta.inject-api")
116+
testImplementation("jakarta.xml.ws:jakarta.xml.ws-api")
117+
testImplementation("net.sourceforge.jtds:jtds")
118+
testImplementation("org.apache.derby:derby")
119+
testImplementation("org.apache.derby:derbytools")
120+
testImplementation("org.awaitility:awaitility")
121+
testImplementation("org.codehaus.janino:janino")
122+
testImplementation("org.eclipse.jetty:jetty-client")
123+
testImplementation("org.eclipse.jetty.http2:jetty-http2-client")
124+
testImplementation("org.eclipse.jetty.http2:jetty-http2-client-transport")
125+
testImplementation("org.firebirdsql.jdbc:jaybird") {
126+
exclude group: "javax.resource", module: "connector-api"
127+
}
128+
testImplementation("org.hsqldb:hsqldb")
129+
testImplementation("org.junit.jupiter:junit-jupiter")
130+
testImplementation("org.mariadb.jdbc:mariadb-java-client") {
131+
exclude group: "org.slf4j", module: "jcl-over-slf4j"
132+
}
133+
testImplementation("org.mockito:mockito-core")
134+
testImplementation("org.mockito:mockito-junit-jupiter")
135+
testImplementation("org.springframework:spring-context-support")
136+
testImplementation("org.springframework:spring-core-test")
137+
testImplementation("org.springframework.data:spring-data-redis")
138+
testImplementation("org.springframework.data:spring-data-r2dbc")
139+
testImplementation("org.xerial:sqlite-jdbc")
140+
141+
testRuntimeOnly("org.testcontainers:jdbc") {
142+
exclude group: "javax.annotation", module: "javax.annotation-api"
143+
exclude group: "javax.xml.bind", module: "jaxb-api"
144+
}
145+
146+
tomcatDistribution("org.apache.tomcat:tomcat:${tomcatVersion}@zip")
147+
}
148+
149+
task extractTomcatConfigProperties(type: Sync) {
150+
destinationDir = file(tomcatConfigProperties)
151+
from {
152+
zipTree(configurations.tomcatDistribution.incoming.files.singleFile).matching {
153+
include '**/conf/catalina.properties'
154+
}.singleFile
155+
}
156+
}
157+
158+
def syncJavaTemplates = tasks.register("syncJavaTemplates", Sync) {
159+
from("src/main/javaTemplates")
160+
into("build/generated-sources/main")
161+
def properties = ["springBootVersion": project.version]
162+
expand(properties)
163+
inputs.properties(properties)
164+
}
165+
166+
tasks.named("checkFormatMain") {
167+
def generatedSources = fileTree("build/generated-sources/main")
168+
// Exclude source generated from the templates as expand(properties) changes line endings on Windows
169+
exclude { candidate -> generatedSources.contains(candidate.file) }
170+
// Add the templates to check that the input is correctly formatted
171+
source(fileTree("src/main/javaTemplates"))
172+
}
173+
174+
plugins.withType(EclipsePlugin) {
175+
eclipse {
176+
synchronizationTasks syncJavaTemplates
177+
}
178+
}
179+
180+
sourceSets {
181+
main {
182+
java {
183+
srcDirs syncJavaTemplates
184+
}
185+
}
186+
test {
187+
output.dir(tomcatConfigProperties, builtBy: "extractTomcatConfigProperties")
188+
}
189+
}
190+
191+
test {
192+
jvmArgs += "--add-opens=java.base/java.net=ALL-UNNAMED"
193+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Application Context Initializers
2+
org.springframework.context.ApplicationContextInitializer=\
3+
org.springframework.boot.rsocket.context.RSocketPortInfoApplicationContextInitializer
4+
5+
# Environment Post Processors
6+
org.springframework.boot.env.EnvironmentPostProcessor=\
7+
org.springframework.boot.reactor.ReactorEnvironmentPostProcessor
8+
9+
# Failure Analyzers
10+
org.springframework.boot.diagnostics.FailureAnalyzer=\
11+
org.springframework.boot.liquibase.LiquibaseChangelogMissingFailureAnalyzer,\
12+
org.springframework.boot.web.server.tomcat.ConnectorStartFailureAnalyzer
13+
14+
# Database Initializer Detectors
15+
org.springframework.boot.sql.init.dependency.DatabaseInitializerDetector=\
16+
org.springframework.boot.flyway.FlywayDatabaseInitializerDetector,\
17+
org.springframework.boot.jdbc.init.DataSourceScriptDatabaseInitializerDetector,\
18+
org.springframework.boot.liquibase.LiquibaseDatabaseInitializerDetector,\
19+
org.springframework.boot.orm.jpa.JpaDatabaseInitializerDetector,\
20+
org.springframework.boot.r2dbc.init.R2dbcScriptDatabaseInitializerDetector
21+
22+
# Depends On Database Initialization Detectors
23+
org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitializationDetector=\
24+
org.springframework.boot.sql.init.dependency.AnnotationDependsOnDatabaseInitializationDetector,\
25+
org.springframework.boot.jdbc.SpringJdbcDependsOnDatabaseInitializationDetector,\
26+
org.springframework.boot.jooq.JooqDependsOnDatabaseInitializationDetector,\
27+
org.springframework.boot.orm.jpa.JpaDependsOnDatabaseInitializationDetector
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
org.springframework.aot.hint.RuntimeHintsRegistrar=\
2+
org.springframework.boot.http.client.ClientHttpRequestFactoryRuntimeHints,\
3+
org.springframework.boot.jdbc.DataSourceBuilderRuntimeHints,\
4+
org.springframework.boot.json.JacksonRuntimeHints,\
5+
org.springframework.boot.logging.java.JavaLoggingSystemRuntimeHints,\
6+
org.springframework.boot.logging.logback.LogbackRuntimeHints,\
7+
org.springframework.boot.web.server.undertow.UndertowWebServer.UndertowWebServerRuntimeHints
8+
9+
org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor=\
10+
org.springframework.boot.jackson.JsonComponentModule.JsonComponentBeanFactoryInitializationAotProcessor
11+
12+
org.springframework.beans.factory.aot.BeanRegistrationAotProcessor=\
13+
org.springframework.boot.jackson.JsonMixinModuleEntriesBeanRegistrationAotProcessor

0 commit comments

Comments
 (0)