Skip to content

Commit c61bf50

Browse files
committed
Upgrade to Spring Framework 5.3 / Boot 2.4 snapshots
This commit also: - Remove Spring Framework substitutions (see spring-projects/spring-framework#22968 (comment) for more details) - Remove web-issue122 sample which seems not relevant anymore - Remove Unnecessary classes and resource configuration from spring-petclinic-jdbc sample - Upgrade to spring Fu 0.4.0-SNAPSHOT - Migrate remaining tests to JUnit 5 - Remove java.lang.management.* from hints - Rename OnlyPresent to OnlyIfPresent See spring-atticgh-138
1 parent 982d9ba commit c61bf50

File tree

117 files changed

+281
-2561
lines changed

Some content is hidden

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

117 files changed

+281
-2561
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<dependency>
3131
<groupId>org.springframework.boot</groupId>
3232
<artifactId>spring-boot-dependencies</artifactId>
33-
<version>2.3.1.RELEASE</version>
33+
<version>2.4.0-SNAPSHOT</version>
3434
<type>pom</type>
3535
<scope>import</scope>
3636
</dependency>

spring-graalvm-native-configuration/src/main/java/org/springframework/boot/autoconfigure/web/reactive/WebFluxHints.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@
4242
"com.fasterxml.jackson.databind.ObjectMapper",
4343
"com.fasterxml.jackson.core.JsonGenerator",
4444
"com.fasterxml.jackson.dataformat.smile.SmileFactory",
45-
"com.google.protobuf.Message",
46-
"org.synchronoss.cloud.nio.multipart.NioMultipartParser"
45+
"com.google.protobuf.Message"
4746
},
4847
access=AccessBits.CLASS|AccessBits.DECLARED_CONSTRUCTORS
4948
),

spring-graalvm-native-configuration/src/main/java/org/springframework/boot/autoconfigure/web/reactive/netty/NettyHints.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@
4949
"io.netty.channel.ChannelHandler",
5050
"io.netty.util.concurrent.GenericFutureListener",
5151
"io.netty.bootstrap.ServerBootstrap$1",
52-
"io.netty.bootstrap.ServerBootstrap$ServerBootstrapAcceptor",
53-
"java.lang.management.ManagementFactory",
54-
"java.lang.management.RuntimeMXBean"},
52+
"io.netty.bootstrap.ServerBootstrap$ServerBootstrapAcceptor"},
5553
access=AccessBits.CLASS|AccessBits.DECLARED_CONSTRUCTORS|AccessBits.DECLARED_METHODS)
5654
})
5755
public class NettyHints implements NativeImageConfiguration {

spring-graalvm-native-configuration/src/main/resources/initialization.json

+26-6
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
{"class": "org.springframework.core.annotation.AnnotationFilter$1"},
6363
{"class": "org.springframework.core.annotation.AnnotationFilter$2"},
6464
{"class": "org.springframework.core.annotation.PackagesAnnotationFilter"},
65-
{"class": "org.springframework.core.GraalDetector"},
65+
{"class": "org.springframework.core.SerializableTypeWrapper"},
6666
{"class": "org.springframework.core.SerializableTypeWrapper$SerializableTypeProxy"},
6767
{"class": "org.springframework.format.annotation.DateTimeFormat$ISO"},
6868
{"class": "org.springframework.http.HttpStatus"},
@@ -72,7 +72,25 @@
7272
{"class": "org.springframework.util.unit.DataUnit"},
7373
{"class": "org.springframework.util.unit.DataSize"},
7474
{"class": "org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter"},
75-
// To avoid XML parsers to be included
75+
{"class": "org.springframework.core.DefaultParameterNameDiscoverer"},
76+
{"class": "org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory"},
77+
{"class": "org.springframework.context.annotation.ConfigurationClassPostProcessor"},
78+
{"class": "org.springframework.context.annotation.ConfigurationClassEnhancer"},
79+
{"class": "org.springframework.aop.framework.DefaultAopProxyFactory"},
80+
81+
// For SPEL removal
82+
{"class": "org.springframework.context.support.AbstractApplicationContext" },
83+
{"class": "org.springframework.core.SpringProperties" },
84+
{"class": "org.springframework.context.event.EventListenerMethodProcessor" },
85+
86+
// For XML removal
87+
{"class": "org.springframework.util.DefaultPropertiesPersister" },
88+
{"class": "org.springframework.core.io.support.PropertiesLoaderUtils" },
89+
{"class": "org.springframework.web.servlet.function.support.RouterFunctionMapping" },
90+
{"class": "org.springframework.web.client.RestTemplate" },
91+
{"class": "org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver" },
92+
{"class": "org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport" },
93+
{"class": "org.springframework.web.socket.sockjs.transport.TransportHandlingSockJsService" },
7694
{"class": "org.springframework.messaging.simp.config.AbstractMessageBrokerConfiguration" },
7795
{"class": "org.springframework.http.MediaType" },
7896
{"class": "org.springframework.http.codec.support.BaseDefaultCodecs" },
@@ -82,12 +100,11 @@
82100
{"class": "org.springframework.util.CollectionUtils" },
83101
{"class": "org.springframework.util.LinkedCaseInsensitiveMap" },
84102
{"class": "org.springframework.util.MimeType" },
85-
{"class": "org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport" },
86-
{"class": "org.springframework.web.socket.sockjs.transport.TransportHandlingSockJsService" },
87-
{"class": "org.springframework.web.client.RestTemplate" },
88-
{"class": "org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter" },
89103
{"class": "org.springframework.beans.factory.xml.XmlBeanDefinitionReader" },
90104
{"class": "org.springframework.util.ReflectionUtils" },
105+
{"class": "org.springframework.beans.PropertyEditorRegistrySupport" },
106+
{"class": "org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter" },
107+
{"class": "org.springframework.core.io.support.ResourcePropertiesPersister" },
91108

92109
// Spring Boot
93110
{"class": "org.springframework.boot.CommandLineRunner"},
@@ -106,6 +123,9 @@
106123
{"package": "org.jboss.logging"},
107124
{"class": "org.slf4j.spi.LocationAwareLogger"},
108125
{"class": "org.slf4j.Logger"},
126+
{"class": "org.apache.commons.logging.LogAdapter"},
127+
{"class": "org.apache.commons.logging.LogAdapter$1"},
128+
{"class": "org.apache.commons.logging.LogAdapter$Slf4jLocationAwareLog"},
109129

110130
{"class": "org.slf4j.event.SubstituteLoggingEvent"},
111131
{"class": "org.slf4j.event.EventRecodingLogger"},

spring-graalvm-native-configuration/src/main/resources/resources.json

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// vvv r2dbc
1010
{"pattern": "\\QMETA-INF/services/io.r2dbc.spi.ConnectionFactoryProvider\\E"},
1111
// vvv springmvc-tomcat
12-
{"pattern": "org/springframework/web/servlet/DispatcherServlet.properties"},
1312
{"pattern": "org/apache/catalina/startup/MimeTypeMappings.properties"},
1413
// ^^^ springmvc-tomcat
1514
// vvv vanilla-tx

spring-graalvm-native-docs/src/main/asciidoc/options.adoc

+6-4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ You can find more details in GraalVM https://github.com/oracle/graal/blob/master
4242

4343
* `-H:+RemoveSaturatedTypeFlows` reduces build time and decrease build memory consumption, especially for big projects.
4444

45+
=== Spring Framework/Boot options
46+
47+
* `-Dspring.xml.ignore=true` removes XML support from Spring Boot, enabling faster compilation and smaller executables.
48+
49+
* `-Dspring.spel.ignore=true` removes SpEL support from Spring Boot, enabling faster compilation and smaller executables.
50+
4551
=== Feature options
4652

4753
The current feature options are as follows:
@@ -57,10 +63,6 @@ will provide initialization and resource configuration but nothing more.
5763

5864
* `-Dspring.native.remove-yaml-support=true` removes Yaml support from Spring Boot, enabling faster compilation and smaller executables.
5965

60-
* `-Dspring.native.remove-xml-support=true` removes XML support from Spring Boot, enabling faster compilation and smaller executables.
61-
62-
* `-Dspring.native.remove-spel-support=true` removes SpEL support from Spring Boot, enabling faster compilation and smaller executables.
63-
6466
* `-Dspring.native.remove-jmx-support=true` removes JMX support from Spring Boot, enabling faster compilation and smaller executables.
6567

6668
* `-Dspring.native.dump-config=/tmp/dump.txt` dumps the configuration to the specified file.

spring-graalvm-native-samples/actuator-webflux/pom.xml

+55-62
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.3.1.RELEASE</version>
8+
<version>2.4.0-SNAPSHOT</version>
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<groupId>com.example</groupId>
@@ -31,13 +31,6 @@
3131
<dependency>
3232
<groupId>org.springframework.boot</groupId>
3333
<artifactId>spring-boot-starter-webflux</artifactId>
34-
<exclusions>
35-
<exclusion>
36-
<groupId>io.netty</groupId>
37-
<artifactId>netty-codec-http2</artifactId>
38-
</exclusion>
39-
</exclusions>
40-
4134
</dependency>
4235

4336
<dependency>
@@ -67,70 +60,70 @@
6760
</plugins>
6861
</build>
6962
<repositories>
70-
<repository>
71-
<id>central</id>
72-
<url>https://repo.maven.apache.org/maven2</url>
73-
<snapshots>
74-
<enabled>false</enabled>
75-
</snapshots>
76-
</repository>
77-
<repository>
78-
<id>spring-release</id>
79-
<name>Spring release</name>
80-
<url>https://repo.spring.io/release</url>
81-
<snapshots>
82-
<enabled>false</enabled>
83-
</snapshots>
84-
</repository>
85-
<repository>
86-
<id>spring-snapshot</id>
87-
<name>Spring Snapshots</name>
88-
<url>https://repo.spring.io/snapshot</url>
89-
<snapshots>
90-
<enabled>true</enabled>
91-
</snapshots>
92-
</repository>
93-
<repository>
94-
<id>spring-milestone</id>
95-
<name>Spring Milestone</name>
96-
<url>https://repo.spring.io/milestone</url>
97-
<snapshots>
98-
<enabled>false</enabled>
99-
</snapshots>
100-
</repository>
63+
<repository>
64+
<id>central</id>
65+
<url>https://repo.maven.apache.org/maven2</url>
66+
<snapshots>
67+
<enabled>false</enabled>
68+
</snapshots>
69+
</repository>
70+
<repository>
71+
<id>spring-release</id>
72+
<name>Spring release</name>
73+
<url>https://repo.spring.io/release</url>
74+
<snapshots>
75+
<enabled>false</enabled>
76+
</snapshots>
77+
</repository>
78+
<repository>
79+
<id>spring-snapshot</id>
80+
<name>Spring Snapshots</name>
81+
<url>https://repo.spring.io/snapshot</url>
82+
<snapshots>
83+
<enabled>true</enabled>
84+
</snapshots>
85+
</repository>
86+
<repository>
87+
<id>spring-milestone</id>
88+
<name>Spring Milestone</name>
89+
<url>https://repo.spring.io/milestone</url>
90+
<snapshots>
91+
<enabled>false</enabled>
92+
</snapshots>
93+
</repository>
10194
</repositories>
10295

10396
<pluginRepositories>
10497
<pluginRepository>
105-
<id>central</id>
106-
<url>https://repo.maven.apache.org/maven2</url>
107-
<snapshots>
108-
<enabled>false</enabled>
109-
</snapshots>
98+
<id>central</id>
99+
<url>https://repo.maven.apache.org/maven2</url>
100+
<snapshots>
101+
<enabled>false</enabled>
102+
</snapshots>
110103
</pluginRepository>
111104
<pluginRepository>
112-
<id>spring-release</id>
113-
<name>Spring release</name>
114-
<url>https://repo.spring.io/release</url>
115-
<snapshots>
116-
<enabled>false</enabled>
117-
</snapshots>
105+
<id>spring-release</id>
106+
<name>Spring release</name>
107+
<url>https://repo.spring.io/release</url>
108+
<snapshots>
109+
<enabled>false</enabled>
110+
</snapshots>
118111
</pluginRepository>
119112
<pluginRepository>
120-
<id>spring-snapshot</id>
121-
<name>Spring Snapshots</name>
122-
<url>https://repo.spring.io/snapshot</url>
123-
<snapshots>
124-
<enabled>true</enabled>
125-
</snapshots>
113+
<id>spring-snapshot</id>
114+
<name>Spring Snapshots</name>
115+
<url>https://repo.spring.io/snapshot</url>
116+
<snapshots>
117+
<enabled>true</enabled>
118+
</snapshots>
126119
</pluginRepository>
127120
<pluginRepository>
128-
<id>spring-milestone</id>
129-
<name>Spring Milestone</name>
130-
<url>https://repo.spring.io/milestone</url>
131-
<snapshots>
132-
<enabled>false</enabled>
133-
</snapshots>
121+
<id>spring-milestone</id>
122+
<name>Spring Milestone</name>
123+
<url>https://repo.spring.io/milestone</url>
124+
<snapshots>
125+
<enabled>false</enabled>
126+
</snapshots>
134127
</pluginRepository>
135128
</pluginRepositories>
136129

0 commit comments

Comments
 (0)