Skip to content

Commit 8c9c9d7

Browse files
author
splanes
committed
Upgrades jdk version to 17:
- Moves from javax to jakarta - Upgrades related plugins that otherwise break the build. - Replaces removed Entity / Component tuplizers from hibernate with a new mechanism.
1 parent 39e8f72 commit 8c9c9d7

Some content is hidden

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

54 files changed

+1400
-767
lines changed

k2-archetype-application/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>com.github.katari</groupId>
1111
<artifactId>k2-parent</artifactId>
12-
<version>0.1.9-SNAPSHOT</version>
12+
<version>0.1.13-SNAPSHOT</version>
1313
<relativePath>../k2-parent/pom.xml</relativePath>
1414
</parent>
1515

k2-archetype-module/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>com.github.katari</groupId>
1111
<artifactId>k2-parent</artifactId>
12-
<version>0.1.9-SNAPSHOT</version>
12+
<version>0.1.13-SNAPSHOT</version>
1313
<relativePath>../k2-parent/pom.xml</relativePath>
1414
</parent>
1515

k2-build-tools/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<parent>
99
<groupId>com.github.katari</groupId>
1010
<artifactId>k2</artifactId>
11-
<version>0.1.9-SNAPSHOT</version>
11+
<version>0.1.13-SNAPSHOT</version>
1212
</parent>
1313

1414
<artifactId>k2-build-tools</artifactId>

k2-core/pom.xml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
<?xml version="1.0" encoding="UTF-8"?>
23

34
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -9,7 +10,7 @@
910
<parent>
1011
<groupId>com.github.katari</groupId>
1112
<artifactId>k2-parent</artifactId>
12-
<version>0.1.9-SNAPSHOT</version>
13+
<version>0.1.13-SNAPSHOT</version>
1314
<relativePath>../k2-parent/pom.xml</relativePath>
1415
</parent>
1516

@@ -67,8 +68,8 @@
6768
</dependency>
6869

6970
<dependency>
70-
<groupId>javax.servlet</groupId>
71-
<artifactId>javax.servlet-api</artifactId>
71+
<groupId>jakarta.servlet</groupId>
72+
<artifactId>jakarta.servlet-api</artifactId>
7273
</dependency>
7374

7475
<dependency>

k2-core/src/main/java/com/k2/core/DispatcherServletConfiguration.java

+13-15
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,27 @@
22

33
package com.k2.core;
44

5-
import org.springframework.web.servlet.config.annotation
6-
.ResourceHandlerRegistration;
7-
import org.springframework.web.servlet.config.annotation
8-
.ResourceHandlerRegistry;
9-
import org.springframework.web.servlet.config.annotation
10-
.WebMvcConfigurationSupport;
11-
import org.springframework.web.servlet.mvc.method.annotation
12-
.RequestMappingHandlerAdapter;
13-
import org.springframework.web.servlet.mvc.method.annotation
14-
.RequestMappingHandlerMapping;
15-
165
import java.util.List;
176

187
import org.springframework.beans.factory.annotation.Autowired;
198
import org.springframework.beans.factory.annotation.Value;
209
import org.springframework.context.ApplicationContext;
2110
import org.springframework.context.annotation.Bean;
2211
import org.springframework.context.annotation.Configuration;
23-
import org.springframework.context.support
24-
.PropertySourcesPlaceholderConfigurer;
12+
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
2513
import org.springframework.format.FormatterRegistry;
2614
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar;
2715
import org.springframework.http.converter.HttpMessageConverter;
16+
import org.springframework.web.servlet.config.annotation
17+
.ResourceHandlerRegistration;
18+
import org.springframework.web.servlet.config.annotation
19+
.ResourceHandlerRegistry;
20+
import org.springframework.web.servlet.config.annotation
21+
.WebMvcConfigurationSupport;
22+
import org.springframework.web.servlet.mvc.method.annotation
23+
.RequestMappingHandlerAdapter;
24+
import org.springframework.web.servlet.mvc.method.annotation
25+
.RequestMappingHandlerMapping;
2826

2927
/** Custom configuration for the dispatcher servlet application context
3028
*
@@ -85,8 +83,8 @@ protected RequestMappingHandlerMapping createRequestMappingHandlerMapping() {
8583
@Bean
8684
public RequestMappingHandlerAdapter requestMappingHandlerAdapter(
8785
final List<HttpMessageConverter<?>> converters) {
88-
RequestMappingHandlerAdapter adapter;
89-
adapter = super.requestMappingHandlerAdapter();
86+
RequestMappingHandlerAdapter adapter =
87+
super.createRequestMappingHandlerAdapter();
9088

9189
if (!converters.isEmpty()) {
9290
adapter.setMessageConverters(converters);

k2-core/src/main/java/com/k2/core/HomeServlet.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
import java.io.IOException;
66

7-
import javax.servlet.ServletException;
8-
import javax.servlet.http.HttpServlet;
9-
import javax.servlet.http.HttpServletRequest;
10-
import javax.servlet.http.HttpServletResponse;
7+
import jakarta.servlet.ServletException;
8+
import jakarta.servlet.http.HttpServlet;
9+
import jakarta.servlet.http.HttpServletRequest;
10+
import jakarta.servlet.http.HttpServletResponse;
1111

1212
import org.apache.commons.lang3.Validate;
1313
import org.springframework.web.servlet.view.RedirectView;

k2-core/src/main/java/com/k2/core/K2WebApplicationContext.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import java.util.LinkedList;
88
import java.util.List;
99

10-
import javax.servlet.ServletContext;
10+
import jakarta.servlet.ServletContext;
1111

1212
import org.apache.commons.lang3.Validate;
1313

k2-core/src/main/java/com/k2/core/ModuleDefinition.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import java.beans.Introspector;
1919
import java.lang.reflect.Method;
2020

21-
import javax.servlet.ServletContext;
21+
import jakarta.servlet.ServletContext;
2222

2323
import org.springframework.beans.factory.config.BeanDefinition;
2424
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;

k2-core/src/main/java/com/k2/core/WebConfiguration.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ public void customize(final Server pServer) {
106106
* shows a hardcoded message.
107107
*/
108108
@Bean(name = "k2.homeServlet")
109-
public ServletRegistrationBean homeServlet(
109+
public ServletRegistrationBean<HomeServlet> homeServlet(
110110
@Qualifier("k2.landingUrl") final String landingUrl) {
111111

112112
HomeServlet homeServlet = new HomeServlet(landingUrl);
113-
ServletRegistrationBean servletBean;
114-
servletBean = new ServletRegistrationBean(homeServlet, false, "");
113+
ServletRegistrationBean<HomeServlet> servletBean;
114+
servletBean = new ServletRegistrationBean<>(homeServlet, false, "");
115115
servletBean.setOrder(Integer.MAX_VALUE);
116116
return servletBean;
117117
}

k2-core/src/test/java/com/k2/core/ApplicationTest.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
import java.io.IOException;
1010

11-
import javax.servlet.Filter;
12-
import javax.servlet.FilterChain;
13-
import javax.servlet.ServletException;
14-
import javax.servlet.ServletRequest;
15-
import javax.servlet.ServletResponse;
16-
import javax.servlet.http.HttpServletResponse;
11+
import jakarta.servlet.Filter;
12+
import jakarta.servlet.FilterChain;
13+
import jakarta.servlet.ServletException;
14+
import jakarta.servlet.ServletRequest;
15+
import jakarta.servlet.ServletResponse;
16+
import jakarta.servlet.http.HttpServletResponse;
1717

1818
import org.junit.BeforeClass;
1919
import org.junit.Test;

k2-hibernate/pom.xml

+6-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>com.github.katari</groupId>
1111
<artifactId>k2-parent</artifactId>
12-
<version>0.1.9-SNAPSHOT</version>
12+
<version>0.1.13-SNAPSHOT</version>
1313
<relativePath>../k2-parent/pom.xml</relativePath>
1414
</parent>
1515

@@ -73,8 +73,9 @@
7373
</dependency>
7474

7575
<dependency>
76-
<groupId>com.h2database</groupId>
77-
<artifactId>h2</artifactId>
76+
<groupId>org.hsqldb</groupId>
77+
<artifactId>hsqldb</artifactId>
78+
<scope>test</scope>
7879
</dependency>
7980

8081
<!-- ++++++++++++++++++++++++++++++++++++++++++++++ -->
@@ -86,8 +87,8 @@
8687
</dependency>
8788

8889
<dependency>
89-
<groupId>javax.servlet</groupId>
90-
<artifactId>javax.servlet-api</artifactId>
90+
<groupId>jakarta.servlet</groupId>
91+
<artifactId>jakarta.servlet-api</artifactId>
9192
</dependency>
9293

9394
<dependency>

0 commit comments

Comments
 (0)