-
Notifications
You must be signed in to change notification settings - Fork 49
✨ Spring 6 migration rules #359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # Spring Migration Rules - Unaddressed Issues | ||
|
|
||
| This document lists issues from the `spring-migration/6` label that were **not addressed** in this PR, along with the reasons. | ||
|
|
||
| ## Issues Assigned to Other Contributors | ||
|
|
||
| The following issues are assigned to other contributors and were skipped to avoid duplication of effort: | ||
|
|
||
| | Issue | Title | Assignee | Notes | | ||
| |-------|-------|----------|-------| | ||
| | #145 | Create rules for EclipseLink | billwheatley | In progress by assignee | | ||
| | #152 | Create rules for controller detection | jmle | In progress by assignee | | ||
|
|
||
| ## Issues Already Covered by Existing or New Rules | ||
|
|
||
| The following issues are already addressed by rules in this PR or existing rulesets: | ||
|
|
||
| | Issue | Title | Covered By | | ||
| |-------|-------|------------| | ||
| | #133 | Create rule for minimum usage of Java17 and JakartaEE 9+ | Existing baseline rules | | ||
| | #136 | Create rules for removed `org.springframework.cache.ehcache` package | removed-apis-00001 | | ||
| | #138 | Create rules for bean property determination | core-container-00001 | | ||
| | #144 | Create rules for Hibernate Validator upgrade | data-access-00060 (new) | | ||
| | #148 | Create rules for backwards compatibility with database-specific error codes | data-access-00030 | | ||
| | #151 | Create rules for the trailing slash matching configuration | web-applications-00001 | | ||
| | #154 | Create rules for RestTemplate Apache HttpClient 5 requirement | Related to #175 | | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Covered By" entry for
🤖 Prompt for AI Agents |
||
| | #156 | Create rules for `SourceHttpMessageConverter` | web-applications-00030 | | ||
| | #166 | Create rules for migration to Hibernate 5.6 | data-access-00001 | | ||
|
|
||
| ## Parent/Tracking Issues | ||
|
|
||
| | Issue | Title | Notes | | ||
| |-------|-------|-------| | ||
| | #161 | Support migration of Spring Framework 5->6 | Parent tracking issue - not actionable | | ||
|
|
||
| ## Summary | ||
|
|
||
| - **Total issues with spring-migration/6 label:** 23 | ||
| - **Issues addressed in this PR:** 11 | ||
| - **Issues assigned to other contributors:** 2 | ||
| - **Issues already covered by existing or new rules:** 9 | ||
| - **Parent/tracking issues:** 1 | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -160,3 +160,116 @@ | |||||||||||||||||||||||||
| - title: 'Spring 6.0 migration guide' | ||||||||||||||||||||||||||
| url: https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-6.0-Release-Notes#core-container | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - ruleID: spring-framework-5.x-to-6.0-core-container-00040 | ||||||||||||||||||||||||||
| category: mandatory | ||||||||||||||||||||||||||
| effort: 1 | ||||||||||||||||||||||||||
| labels: | ||||||||||||||||||||||||||
| - konveyor.io/source=spring5 | ||||||||||||||||||||||||||
| - konveyor.io/target=spring6+ | ||||||||||||||||||||||||||
| - konveyor.io/source=spring-boot2 | ||||||||||||||||||||||||||
| - konveyor.io/target=spring-boot3+ | ||||||||||||||||||||||||||
| when: | ||||||||||||||||||||||||||
| java.referenced: | ||||||||||||||||||||||||||
| pattern: javax.inject.Inject | ||||||||||||||||||||||||||
| location: ANNOTATION | ||||||||||||||||||||||||||
|
Comment on lines
+171
to
+174
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Detection gap: The Consider extending the 🔧 Proposed fix when:
- java.referenced:
- pattern: javax.inject.Inject
- location: ANNOTATION
+ or:
+ - java.referenced:
+ pattern: javax.inject.Inject
+ location: ANNOTATION
+ - java.referenced:
+ pattern: javax.inject.Named
+ location: ANNOTATION📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
| description: JSR-330 @Inject annotation must be migrated to Jakarta namespace | ||||||||||||||||||||||||||
| message: | | ||||||||||||||||||||||||||
| The JSR-330 based `@Inject` annotation is to be found in `jakarta.inject` now. The `javax.inject` package | ||||||||||||||||||||||||||
| is no longer supported in Spring Framework 6.0 as part of the Jakarta EE 9+ baseline migration. | ||||||||||||||||||||||||||
| The corresponding JSR-250 based annotations `@PostConstruct` and `@PreDestroy` are to be found in `jakarta.annotation`. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| **Migration Guidance:** | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Update your imports from `javax.inject` to `jakarta.inject`: | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| **Before:** | ||||||||||||||||||||||||||
| ```java | ||||||||||||||||||||||||||
| import javax.inject.Inject; | ||||||||||||||||||||||||||
| import javax.inject.Named; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| @Named | ||||||||||||||||||||||||||
| public class MyService { | ||||||||||||||||||||||||||
| @Inject | ||||||||||||||||||||||||||
| private MyRepository repository; | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| **After:** | ||||||||||||||||||||||||||
| ```java | ||||||||||||||||||||||||||
| import jakarta.inject.Inject; | ||||||||||||||||||||||||||
| import jakarta.inject.Named; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| @Named | ||||||||||||||||||||||||||
| public class MyService { | ||||||||||||||||||||||||||
| @Inject | ||||||||||||||||||||||||||
| private MyRepository repository; | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| **Maven Dependency Update:** | ||||||||||||||||||||||||||
| ```xml | ||||||||||||||||||||||||||
| <!-- Before --> | ||||||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||||||
| <groupId>javax.inject</groupId> | ||||||||||||||||||||||||||
| <artifactId>javax.inject</artifactId> | ||||||||||||||||||||||||||
| <version>1</version> | ||||||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| <!-- After --> | ||||||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||||||
| <groupId>jakarta.inject</groupId> | ||||||||||||||||||||||||||
| <artifactId>jakarta.inject-api</artifactId> | ||||||||||||||||||||||||||
| <version>2.0.1</version> | ||||||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||
| links: | ||||||||||||||||||||||||||
| - title: 'Spring 6.0 migration guide - Core Container' | ||||||||||||||||||||||||||
| url: https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-6.0-Release-Notes#core-container | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - ruleID: spring-framework-5.x-to-6.0-core-container-00050 | ||||||||||||||||||||||||||
| category: potential | ||||||||||||||||||||||||||
| effort: 2 | ||||||||||||||||||||||||||
| labels: | ||||||||||||||||||||||||||
| - konveyor.io/source=spring5 | ||||||||||||||||||||||||||
| - konveyor.io/target=spring6+ | ||||||||||||||||||||||||||
| - konveyor.io/source=spring-boot2 | ||||||||||||||||||||||||||
| - konveyor.io/target=spring-boot3+ | ||||||||||||||||||||||||||
| when: | ||||||||||||||||||||||||||
| java.referenced: | ||||||||||||||||||||||||||
| pattern: org.springframework.core.LocalVariableTableParameterNameDiscoverer | ||||||||||||||||||||||||||
| description: LocalVariableTableParameterNameDiscoverer is deprecated in Spring 6 | ||||||||||||||||||||||||||
| message: | | ||||||||||||||||||||||||||
| `LocalVariableTableParameterNameDiscoverer` is deprecated in Spring Framework 6.0 in favor of | ||||||||||||||||||||||||||
| `StandardReflectionParameterNameDiscoverer`. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| The `LocalVariableTableParameterNameDiscoverer` reads parameter names from the debug information in | ||||||||||||||||||||||||||
| class files, which requires classes to be compiled with debug information. The new | ||||||||||||||||||||||||||
| `StandardReflectionParameterNameDiscoverer` uses the standard Java reflection API which is more | ||||||||||||||||||||||||||
| reliable and doesn't require debug symbols. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| **Migration Guidance:** | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| **Before:** | ||||||||||||||||||||||||||
| ```java | ||||||||||||||||||||||||||
| import org.springframework.core.LocalVariableTableParameterNameDiscoverer; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| LocalVariableTableParameterNameDiscoverer discoverer = | ||||||||||||||||||||||||||
| new LocalVariableTableParameterNameDiscoverer(); | ||||||||||||||||||||||||||
| String[] paramNames = discoverer.getParameterNames(method); | ||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| **After:** | ||||||||||||||||||||||||||
| ```java | ||||||||||||||||||||||||||
| import org.springframework.core.StandardReflectionParameterNameDiscoverer; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| StandardReflectionParameterNameDiscoverer discoverer = | ||||||||||||||||||||||||||
| new StandardReflectionParameterNameDiscoverer(); | ||||||||||||||||||||||||||
| String[] paramNames = discoverer.getParameterNames(method); | ||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| **Note:** Ensure your code is compiled with the `-parameters` flag to retain parameter names | ||||||||||||||||||||||||||
| in the bytecode for reflection access. | ||||||||||||||||||||||||||
| links: | ||||||||||||||||||||||||||
| - title: 'Spring 6.0 migration guide - Core Container' | ||||||||||||||||||||||||||
| url: https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-6.0-Release-Notes#core-container | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -202,3 +202,170 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| links: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - title: 'Spring 6.0 migration guide' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| url: https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-6.0-Release-Notes#data-access-and-transactions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - ruleID: spring-framework-5.x-to-6.0-data-access-00040 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| category: potential | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| effort: 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| labels: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - konveyor.io/source=spring5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - konveyor.io/target=spring6+ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - konveyor.io/source=spring-boot2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - konveyor.io/target=spring-boot3+ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| when: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| or: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - java.referenced: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pattern: org.springframework.dao.CannotSerializeTransactionException | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - java.referenced: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pattern: org.springframework.dao.DeadlockLoserDataAccessException | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: Deprecated data access exceptions detected in Spring 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| message: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `CannotSerializeTransactionException` and `DeadlockLoserDataAccessException` are deprecated as of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Spring Framework 6.0.3 due to their inconsistent JDBC semantics. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Migration Guidance:** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Replace usage of these deprecated exceptions with the `PessimisticLockingFailureException` base class | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| or its common `CannotAcquireLockException` subclass, which provides consistent semantics aligned with | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| JPA/Hibernate in all default exception translation scenarios. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Before:** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```java | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // database operation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } catch (CannotSerializeTransactionException e) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // handle serialization failure | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } catch (DeadlockLoserDataAccessException e) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // handle deadlock | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **After:** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```java | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // database operation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } catch (CannotAcquireLockException e) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // handle lock acquisition failure (includes serialization and deadlock scenarios) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Or use the base class for broader catch: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| catch (PessimisticLockingFailureException e) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // handle any pessimistic locking failure | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| links: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - title: 'Spring 6.0 migration guide - Data Access' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| url: https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-6.0-Release-Notes#data-access-and-transactions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - ruleID: spring-framework-5.x-to-6.0-data-access-00050 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| category: potential | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| effort: 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| labels: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - konveyor.io/source=spring5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - konveyor.io/target=spring6+ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - konveyor.io/source=spring-boot2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - konveyor.io/target=spring-boot3+ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| when: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| or: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - java.referenced: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pattern: org.springframework.jdbc.support.SQLStateSQLExceptionTranslator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - java.referenced: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pattern: org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - java.referenced: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pattern: org.springframework.jdbc.support.SQLExceptionTranslator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: JDBC exception translator default has changed in Spring 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| message: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Spring Framework 6.0 has changed the default JDBC exception translator to `SQLExceptionSubclassTranslator`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| This translator detects JDBC driver subclasses and common SQL state indications without database product | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name resolution at runtime. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Key Changes:** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Default translator is now `SQLExceptionSubclassTranslator` (JDBC 4 based) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Common SQL state check for `DuplicateKeyException` is now included | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Database product name resolution is no longer done at runtime by default | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Impact Assessment:** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| If your code explicitly uses or extends these classes: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `SQLStateSQLExceptionTranslator` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `SQLErrorCodeSQLExceptionTranslator` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `SQLExceptionTranslator` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Review if the behavior change affects your exception handling logic. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **For backwards compatibility:** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| If you need the legacy behavior, explicitly configure `SQLErrorCodeSQLExceptionTranslator`: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```java | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Bean | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public SQLExceptionTranslator exceptionTranslator(DataSource dataSource) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return new SQLErrorCodeSQLExceptionTranslator(dataSource); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| links: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - title: 'Spring 6.0 migration guide - Data Access' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| url: https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-6.0-Release-Notes#data-access-and-transactions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - ruleID: spring-framework-5.x-to-6.0-data-access-00060 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| category: mandatory | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| effort: 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| labels: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - konveyor.io/source=spring5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - konveyor.io/target=spring6+ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - konveyor.io/source=spring-boot2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - konveyor.io/target=spring-boot3+ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| when: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| or: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - java.dependency: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: org.hibernate.validator.hibernate-validator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| upperbound: 6.99.99 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - java.referenced: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pattern: javax.validation* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| location: IMPORT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: Hibernate Validator must be upgraded to 7.0+ for Spring 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+307
to
+323
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid duplicate Hibernate Validator upgrade incidents. Rule 🔧 Proposed narrowing for 00060- when:
- or:
- - java.dependency:
- name: org.hibernate.validator.hibernate-validator
- upperbound: 6.99.99
- - java.referenced:
- pattern: javax.validation*
- location: IMPORT
+ when:
+ java.referenced:
+ pattern: javax.validation.*
+ location: IMPORT📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| message: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Spring Framework 6.0 requires Hibernate Validator 7.0.x or later due to the Jakarta EE 9+ baseline. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Hibernate Validator 7.0 is the first version to use the `jakarta.validation` namespace instead of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `javax.validation`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Migration Guidance:** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Update Dependencies:** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```xml | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- Remove Hibernate Validator 6.x --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- <dependency> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <groupId>org.hibernate.validator</groupId> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <artifactId>hibernate-validator</artifactId> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <version>6.x.x</version> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </dependency> --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!-- Add Hibernate Validator 7.0+ --> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <dependency> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <groupId>org.hibernate.validator</groupId> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <artifactId>hibernate-validator</artifactId> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <version>7.0.5.Final</version> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </dependency> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Update Imports:** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```java | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Before | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import javax.validation.Valid; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import javax.validation.constraints.NotNull; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import javax.validation.constraints.Size; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // After | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import jakarta.validation.Valid; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import jakarta.validation.constraints.NotNull; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import jakarta.validation.constraints.Size; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Key Changes in Hibernate Validator 7.0:** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - All `javax.validation.*` → `jakarta.validation.*` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `javax.el` → `jakarta.el` for Expression Language | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Compatible with Jakarta EE 9+ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| links: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - title: 'Spring 6.0 migration guide - Data Access and Transactions' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| url: https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-6.0-Release-Notes#data-access-and-transactions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - title: 'Hibernate Validator 7.0 Release Announcement' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| url: https://in.relation.to/2020/12/08/hibernate-validator-700-62-cr1-released/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - title: 'Hibernate Validator Migration Guide' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| url: https://hibernate.org/validator/documentation/migration-guide/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # RestTemplate / HttpComponentsClientHttpRequestFactory now requires Apache HttpClient 5. | ||
| # That case is covered by spring-framework-5.x-to-6.0-web-applications-00020 in | ||
| # spring-framework-5.x-to-6.0-web-applications.yaml (see PR #174). | ||
| [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-referential assignee in "Other Contributors" table
Issue
#152listsjmleas the assignee under the "Issues Assigned to Other Contributors" section, butjmleis the author of this very PR. Either this issue is genuinely being deferred (in which case the note should explain why it was skipped despite being self-assigned), or it should be moved to a different category.🤖 Prompt for AI Agents