Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit 697840d

Browse files
committed
Upgrade to Spring Boot 2.7.7
It fixes Spring Boot 2.7.6+ compatiblity. Closes gh-1740
1 parent 3d655ba commit 697840d

File tree

14 files changed

+27
-28
lines changed

14 files changed

+27
-28
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<asm.version>9.2</asm.version>
1515
<graalvm.version>22.1.0.1</graalvm.version>
1616
<docs.resources.version>0.2.1.RELEASE</docs.resources.version>
17-
<spring.boot.version>2.7.1</spring.boot.version>
17+
<spring.boot.version>2.7.7</spring.boot.version>
1818
<spring.cloud.version>2021.0.3</spring.cloud.version>
1919
<spring.security.authorization-server.version>0.1.0</spring.security.authorization-server.version>
2020
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

samples/commandlinerunner-gradle/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'org.springframework.boot' version '2.7.1'
2+
id 'org.springframework.boot' version '2.7.7'
33
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
44
id 'org.springframework.experimental.aot' version '0.12.2-SNAPSHOT'
55
id 'java'

samples/commandlinerunner-log4j2/.ignore

Whitespace-only changes.

samples/maven-parent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.springframework.boot</groupId>
99
<artifactId>spring-boot-starter-parent</artifactId>
10-
<version>2.7.1</version>
10+
<version>2.7.7</version>
1111
<relativePath/>
1212
</parent>
1313
<groupId>org.springframework.experimental</groupId>

samples/multi-modules/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
3-
id 'org.springframework.boot' version '2.7.1' apply false
3+
id 'org.springframework.boot' version '2.7.7' apply false
44
id 'org.springframework.experimental.aot' version '0.12.2-SNAPSHOT' apply false
55
}
66

samples/multi-modules/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>2.7.1</version>
8+
<version>2.7.7</version>
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<groupId>com.example</groupId>

samples/security-kotlin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
33

44
plugins {
5-
id("org.springframework.boot") version "2.7.1"
5+
id("org.springframework.boot") version "2.7.7"
66
id("io.spring.dependency-management") version "1.0.10.RELEASE"
77
id("org.springframework.experimental.aot") version "0.12.2-SNAPSHOT"
88
kotlin("jvm") version "1.6.10"

samples/webmvc-kotlin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage
33

44
plugins {
5-
id("org.springframework.boot") version "2.7.1"
5+
id("org.springframework.boot") version "2.7.7"
66
id("io.spring.dependency-management") version "1.0.10.RELEASE"
77
id("org.springframework.experimental.aot") version "0.12.2-SNAPSHOT"
88
kotlin("jvm") version "1.6.10"

spring-aot-maven-plugin/src/it/runner/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>2.7.1</version>
8+
<version>2.7.7</version>
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<groupId>io.spring.test</groupId>

spring-aot/src/main/java/org/springframework/boot/AotApplicationContextFactory.java

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.springframework.core.env.ConfigurableEnvironment;
2727
import org.springframework.core.env.StandardEnvironment;
2828
import org.springframework.core.io.ResourceLoader;
29+
import org.springframework.util.Assert;
2930

3031
/**
3132
* Prepare an application context for AOT processing.
@@ -75,25 +76,17 @@ private GenericApplicationContext createApplicationContext(SpringApplication app
7576
}
7677

7778
private static ConfigurableEnvironment getOrCreateEnvironment(WebApplicationType webApplicationType) {
78-
switch (webApplicationType) {
79-
case SERVLET:
80-
return new ApplicationServletEnvironment();
81-
case REACTIVE:
82-
return new ApplicationReactiveWebEnvironment();
83-
default:
84-
return new ApplicationEnvironment();
85-
}
79+
ConfigurableEnvironment environment = ApplicationContextFactory.DEFAULT.createEnvironment(webApplicationType);
80+
return (environment != null) ? environment : new ApplicationEnvironment();
8681
}
8782

8883
private static Class<? extends StandardEnvironment> deduceEnvironmentClass(WebApplicationType webApplicationType) {
89-
switch (webApplicationType) {
90-
case SERVLET:
91-
return ApplicationServletEnvironment.class;
92-
case REACTIVE:
93-
return ApplicationReactiveWebEnvironment.class;
94-
default:
95-
return ApplicationEnvironment.class;
84+
Class<? extends ConfigurableEnvironment> environmentType = ApplicationContextFactory.DEFAULT.getEnvironmentType(webApplicationType);
85+
if (environmentType == null) {
86+
return ApplicationEnvironment.class;
9687
}
88+
Assert.isAssignable(StandardEnvironment.class, environmentType);
89+
return (Class<? extends StandardEnvironment>) environmentType;
9790
}
9891

9992
private void bindToSpringApplication(ConfigurableEnvironment environment, SpringApplication application) {

0 commit comments

Comments
 (0)