diff --git a/settings.gradle b/settings.gradle index c0b0f2b017c..2cfefad9012 100644 --- a/settings.gradle +++ b/settings.gradle @@ -64,6 +64,7 @@ include "spring-boot-project:spring-boot-actuator-integration-tests" include "spring-boot-project:spring-boot-amqp" include "spring-boot-project:spring-boot-artemis" include "spring-boot-project:spring-boot-autoconfigure" +include "spring-boot-project:spring-boot-autoconfigure-classic" include "spring-boot-project:spring-boot-batch" include "spring-boot-project:spring-boot-cache" include "spring-boot-project:spring-boot-cassandra" diff --git a/spring-boot-project/spring-boot-autoconfigure-classic/build.gradle b/spring-boot-project/spring-boot-autoconfigure-classic/build.gradle new file mode 100644 index 00000000000..18c9964a94c --- /dev/null +++ b/spring-boot-project/spring-boot-autoconfigure-classic/build.gradle @@ -0,0 +1,287 @@ +/* + * Copyright 2012-present 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id "java-library" + id "org.springframework.boot.deployed" +} + +description = "Spring Boot AutoConfigure Classic" + +dependencies { + api(project(":spring-boot-project:spring-boot-autoconfigure")) + api(project(":spring-boot-project:spring-boot-activemq")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-amqp")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-artemis")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-batch")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-cache")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-cassandra")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-cloudfoundry")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-couchbase")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-data-cassandra")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-data-commons")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-data-couchbase")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-data-elasticsearch")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-data-jdbc")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-data-jpa")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-data-ldap")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-data-mongodb")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-data-neo4j")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-data-r2dbc")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-data-redis")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-data-rest")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-elasticsearch")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-flyway")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-freemarker")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-graphql")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-groovy-templates")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-gson")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-h2console")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-hateoas")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-hazelcast")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-health")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-hibernate")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-http-client")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-http-codec")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-http-converter")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-integration")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-jackson")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-jdbc")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-jersey")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-jetty")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-jms")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-jooq")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-jpa")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-jsonb")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-kafka")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-ldap")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-liquibase")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-mail")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-metrics")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-mongodb")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-mustache")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-neo4j")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-netty")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-observation")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-opentelemetry")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-pulsar")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-quartz")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-r2dbc")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-reactor")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-reactor-netty")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-restclient")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-rsocket")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-security")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-security-oauth2-authorization-server")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-security-oauth2-client")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-security-oauth2-resource-server")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-security-saml2")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-sendgrid")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-servlet")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-session")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-session-data-mongodb")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-session-data-redis")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-session-hazelcast")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-session-jdbc")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-sql")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-thymeleaf")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-tomcat")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-tracing")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-tx")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-undertow")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-validation")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-webclient")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-webflux")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-webmvc")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-webservices")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-websocket")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-web-server")) { + transitive = false + } + api(project(":spring-boot-project:spring-boot-zipkin")) { + transitive = false + } +} diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index a06986a1125..9dd3ebe846d 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -1989,6 +1989,7 @@ bom { "spring-boot-amqp", "spring-boot-artemis", "spring-boot-autoconfigure", + "spring-boot-autoconfigure-classic", "spring-boot-autoconfigure-processor", "spring-boot-batch", "spring-boot-buildpack-platform", diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/build.gradle new file mode 100644 index 00000000000..35b390cecb6 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/build.gradle @@ -0,0 +1,28 @@ +/* + * Copyright 2012-present 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id "java" +} + +description = "Spring Boot Auto-Configure Classic smoke test" + +dependencies { + implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter")) + implementation(project(":spring-boot-project:spring-boot-autoconfigure-classic")) + + testImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test")) +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/src/main/java/smoketest/autoconfigureclassic/SampleAutoConfigureClassicApplication.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/src/main/java/smoketest/autoconfigureclassic/SampleAutoConfigureClassicApplication.java new file mode 100644 index 00000000000..18d641e1224 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/src/main/java/smoketest/autoconfigureclassic/SampleAutoConfigureClassicApplication.java @@ -0,0 +1,35 @@ +/* + * Copyright 2012-present 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package smoketest.autoconfigureclassic; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SampleAutoConfigureClassicApplication implements CommandLineRunner { + + @Override + public void run(String... args) throws Exception { + System.out.println("Auto-Configure Classic!"); + } + + public static void main(String[] args) { + SpringApplication.run(SampleAutoConfigureClassicApplication.class, args); + } + +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/src/main/resources/application.properties b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/src/main/resources/application.properties new file mode 100644 index 00000000000..bfd3a3a2ac8 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/src/main/resources/application.properties @@ -0,0 +1,6 @@ +test.name=Phil +sample.name=Andy + +spring.profiles.validate=false +spring.profiles.active=a+very(silly)!name + diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/src/main/resources/banner.jpg b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/src/main/resources/banner.jpg new file mode 100644 index 00000000000..f196fed2c3f Binary files /dev/null and b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/src/main/resources/banner.jpg differ diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/src/main/resources/banner.txt b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/src/main/resources/banner.txt new file mode 100644 index 00000000000..2634c44793a --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/src/main/resources/banner.txt @@ -0,0 +1 @@ +${Ansi.GREEN} :: Sample application build with Spring Boot${spring-boot.formatted-version} ::${Ansi.DEFAULT} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/src/test/java/smoketest/autoconfigureclassic/SampleAutoConfigureClassicApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/src/test/java/smoketest/autoconfigureclassic/SampleAutoConfigureClassicApplicationTests.java new file mode 100644 index 00000000000..a514859ec57 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-autoconfigure-classic/src/test/java/smoketest/autoconfigureclassic/SampleAutoConfigureClassicApplicationTests.java @@ -0,0 +1,41 @@ +/* + * Copyright 2012-present 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package smoketest.autoconfigureclassic; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; + +import org.springframework.boot.test.system.CapturedOutput; +import org.springframework.boot.test.system.OutputCaptureExtension; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link SampleAutoConfigureClassicApplication}. + * + * @author Phillip Webb + */ +@ExtendWith(OutputCaptureExtension.class) +class SampleAutoConfigureClassicApplicationTests { + + @Test + void testApplicationRuns(CapturedOutput output) { + SampleAutoConfigureClassicApplication.main(new String[0]); + assertThat(output).contains("Auto-Configure Classic!"); + } + +}