<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alpha Solutions</title>
    <description>The latest articles on DEV Community by Alpha Solutions (@alphasolutionsw).</description>
    <link>https://dev.to/alphasolutionsw</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4285042%2F10afe692-acf2-4baf-b63e-394577f4bd85.png</url>
      <title>DEV Community: Alpha Solutions</title>
      <link>https://dev.to/alphasolutionsw</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alphasolutionsw"/>
    <language>en</language>
    <item>
      <title>A Practical Checklist for Upgrading to Java 17/21 and Spring Boot 3</title>
      <dc:creator>Alpha Solutions</dc:creator>
      <pubDate>Sat, 05 Dec 2026 16:16:30 +0000</pubDate>
      <link>https://dev.to/alphasolutionsw/a-practical-checklist-for-upgrading-to-java-1721-and-spring-boot-3-5f61</link>
      <guid>https://dev.to/alphasolutionsw/a-practical-checklist-for-upgrading-to-java-1721-and-spring-boot-3-5f61</guid>
      <description>&lt;p&gt;I've spent 16+ years with Java and Spring Boot, and this upgrade still catches teams off guard. It isn't one change. It's a JDK baseline move, a Jakarta namespace rename, and a major Spring Boot release, and those go badly if you try to do them all at once.&lt;/p&gt;

&lt;p&gt;This is the order I use, and it matches what the Spring team recommends: get onto the latest Spring Boot 2.7.x first, then Java 17, then Spring Boot 3. Java 21 comes after you're on a Boot 3 line that officially supports it (3.2 and later).&lt;/p&gt;

&lt;p&gt;As of late 2026, Spring Boot 4.x is the current major line. You still have to make this 2-to-3 jump first — Java 17 and Jakarta EE are the hard part. Land on a recent 3.x, get a green build and a clean staging run, then check &lt;a href="https://github.com/spring-projects/spring-boot/wiki/Supported-Versions" rel="noopener noreferrer"&gt;Spring's current supported versions&lt;/a&gt; for the next hop.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Get to the latest Spring Boot 2.7.x and clear the deprecations
&lt;/h2&gt;

&lt;p&gt;Don't start from 2.4 or 2.5 and jump to 3. The official &lt;a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide" rel="noopener noreferrer"&gt;Spring Boot 3.0 migration guide&lt;/a&gt; assumes you are coming from 2.7.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bump to the latest 2.7.x patch.&lt;/li&gt;
&lt;li&gt;Fix every deprecation warning you can. Methods, classes, and properties that were deprecated in Boot 2.x were removed in 3.0.&lt;/li&gt;
&lt;li&gt;Inventory libraries that Spring Boot doesn't manage (Spring Cloud, internal starters, old SOAP or JAXB stacks). Find Boot 3 / Jakarta-compatible versions before you move.&lt;/li&gt;
&lt;li&gt;If you use Spring Security, consider upgrading the Boot 2.7 app to Spring Security 5.8 first. Boot 2.7 ships an older 5.7 line; 5.8 was published specifically as a bridge to Security 6, and you override the version yourself. Follow the Security team's "prepare for 6.0" guide while you're still on 2.7, then the &lt;a href="https://github.com/spring-projects/spring-security/wiki/Spring-Security-6.0-Migration-Guide" rel="noopener noreferrer"&gt;5.8-to-6.0 guide&lt;/a&gt; when you take Boot 3.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ship this as its own release if you can. A boring 2.7 upgrade is a much better baseline than a mixed-in Jakarta rewrite.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Move the JDK to 17 while you are still on Boot 2.7
&lt;/h2&gt;

&lt;p&gt;Spring Boot 3 requires Java 17. Boot 2.7 already runs well on 17, so do the JDK move first and keep Boot on 2.7. Don't jump to Java 21 yet: that isn't an official baseline for Boot 2.7, and Boot 3.0 was tested through JDK 19. Official Java 21 support arrives with Spring Boot 3.2.&lt;/p&gt;

&lt;p&gt;Set the language level in the build:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;properties&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;java.version&amp;gt;&lt;/span&gt;17&lt;span class="nt"&gt;&amp;lt;/java.version&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/properties&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Gradle, set &lt;code&gt;sourceCompatibility&lt;/code&gt; / &lt;code&gt;targetCompatibility&lt;/code&gt;, or better, &lt;code&gt;JavaLanguageVersion.of(17)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Watch for APIs and modules that left the JDK after 8:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;JAXB, JAX-WS, and related Java EE modules&lt;/strong&gt; were removed in JDK 11 (&lt;a href="https://openjdk.org/jeps/320" rel="noopener noreferrer"&gt;JEP 320&lt;/a&gt;). On Boot 2.7 / Java 17, add the &lt;code&gt;javax.*&lt;/code&gt; artifacts you still need (&lt;code&gt;javax.xml.bind:jaxb-api&lt;/code&gt; plus a runtime such as &lt;code&gt;org.glassfish.jaxb:jaxb-runtime&lt;/code&gt;). When you later move to Boot 3, switch those to the Jakarta coordinates (&lt;code&gt;jakarta.xml.bind:jakarta.xml.bind-api&lt;/code&gt; and &lt;code&gt;org.glassfish.jaxb:jaxb-runtime&lt;/code&gt;) and update the imports. If you use &lt;code&gt;spring-boot-starter-parent&lt;/code&gt;, omit the versions and let the BOM manage them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;javax.annotation&lt;/code&gt; types&lt;/strong&gt; such as &lt;code&gt;@PostConstruct&lt;/code&gt; and &lt;code&gt;@Resource&lt;/code&gt; also left the JDK in 11. On Boot 2 you typically add &lt;code&gt;javax.annotation:javax.annotation-api&lt;/code&gt;. On Boot 3 this becomes &lt;code&gt;jakarta.annotation&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nashorn&lt;/strong&gt; was removed in JDK 15. If anything still evaluates JavaScript through &lt;code&gt;javax.script&lt;/code&gt; with Nashorn, replace it before you leave Java 11. GraalJS is a common option if you still need a JS engine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Illegal reflective access&lt;/strong&gt; is denied by default from JDK 17 (&lt;a href="https://openjdk.org/jeps/403" rel="noopener noreferrer"&gt;JEP 403&lt;/a&gt;). The old &lt;code&gt;--illegal-access&lt;/code&gt; flag does nothing useful on 17+. You'll see &lt;code&gt;InaccessibleObjectException&lt;/code&gt; from older libraries that reach into &lt;code&gt;java.*&lt;/code&gt; internals. Prefer a library version that no longer does that. If you must, open only the package you need, for example &lt;code&gt;--add-opens java.base/java.lang=ALL-UNNAMED&lt;/code&gt;. Don't spray &lt;code&gt;--add-opens&lt;/code&gt; across the JDK as a permanent fix.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Compile, run tests, and soak this on Java 17 before you touch Boot 3.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Upgrade to Spring Boot 3 (and Jakarta)
&lt;/h2&gt;

&lt;p&gt;Bump the parent or BOM to a recent Spring Boot 3.x. Spring Boot 3.0 needs Java 17, Spring Framework 6, and Jakarta EE 10 APIs (Servlet 6.0, JPA 3.1, and so on). Prefer a current 3.x maintenance line over 3.0.0 itself.&lt;/p&gt;

&lt;h3&gt;
  
  
  javax to jakarta — don't find-and-replace
&lt;/h3&gt;

&lt;p&gt;A global replace of &lt;code&gt;javax&lt;/code&gt; to &lt;code&gt;jakarta&lt;/code&gt; will break JDK packages that never moved: &lt;code&gt;javax.sql&lt;/code&gt;, &lt;code&gt;javax.crypto&lt;/code&gt;, &lt;code&gt;javax.naming&lt;/code&gt;, &lt;code&gt;javax.net&lt;/code&gt;, &lt;code&gt;javax.management&lt;/code&gt;, &lt;code&gt;javax.annotation.processing&lt;/code&gt;, &lt;code&gt;javax.transaction.xa&lt;/code&gt;, and others.&lt;/p&gt;

&lt;p&gt;Two tools that know the difference:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;IntelliJ IDEA:&lt;/strong&gt; Refactor → Migrate Packages and Classes → Java EE to Jakarta EE. Preview the diff, then apply it module by module if the repo is large.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenRewrite:&lt;/strong&gt; the Spring Boot 3 upgrade recipes are named like &lt;code&gt;org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0&lt;/code&gt;, with follow-on recipes for later 3.x lines. The namespace-only recipe is &lt;code&gt;org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta&lt;/code&gt;. Check the current &lt;a href="https://docs.openrewrite.org/running-recipes/popular-recipe-guides/migrate-to-spring-3" rel="noopener noreferrer"&gt;OpenRewrite docs&lt;/a&gt; for how to run them — recipe artifact distribution has changed, so an old Maven Central one-liner may not resolve.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After the rewrite, search for leftover &lt;code&gt;javax.servlet&lt;/code&gt;, &lt;code&gt;javax.persistence&lt;/code&gt;, &lt;code&gt;javax.validation&lt;/code&gt;, and EE &lt;code&gt;javax.annotation&lt;/code&gt; imports, plus XML namespace URIs in &lt;code&gt;web.xml&lt;/code&gt; / &lt;code&gt;persistence.xml&lt;/code&gt;. Generated sources (JAXB, OpenAPI) need the generator upgraded, not a hand-edit of the output. Libraries with no Jakarta release have to be upgraded or replaced; a recipe can't invent a compatible artifact.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuration properties
&lt;/h3&gt;

&lt;p&gt;Add &lt;code&gt;spring-boot-properties-migrator&lt;/code&gt; as a &lt;strong&gt;runtime&lt;/strong&gt; dependency. It prints diagnostics at startup and temporarily remaps old property names. One well-known rename: Micrometer export properties moved, for example &lt;code&gt;management.metrics.export.prometheus&lt;/code&gt; became &lt;code&gt;management.prometheus.metrics.export&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;org.springframework.boot&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;spring-boot-properties-migrator&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;scope&amp;gt;&lt;/span&gt;runtime&lt;span class="nt"&gt;&amp;lt;/scope&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fix the properties, then &lt;strong&gt;remove the migrator&lt;/strong&gt;. Don't ship it as a permanent crutch. Note that properties added late, such as via &lt;code&gt;@PropertySource&lt;/code&gt;, aren't always picked up.&lt;/p&gt;

&lt;h3&gt;
  
  
  Spring Security 6
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;WebSecurityConfigurerAdapter&lt;/code&gt; is gone. Register a &lt;code&gt;SecurityFilterChain&lt;/code&gt; bean, use &lt;code&gt;authorizeHttpRequests&lt;/code&gt;, and replace &lt;code&gt;antMatchers&lt;/code&gt; / &lt;code&gt;mvcMatchers&lt;/code&gt; / &lt;code&gt;regexMatchers&lt;/code&gt; with &lt;code&gt;requestMatchers&lt;/code&gt;. Prefer the lambda DSL; later 6.x releases dropped the old chained &lt;code&gt;http.csrf().disable()&lt;/code&gt; style.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;springframework&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;annotation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Bean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;springframework&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;annotation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Configuration&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;springframework&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Customizer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;springframework&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;annotation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;web&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;builders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;HttpSecurity&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;org&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;springframework&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;security&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;web&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SecurityFilterChain&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@Configuration&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SecurityConfiguration&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@Bean&lt;/span&gt;
    &lt;span class="nc"&gt;SecurityFilterChain&lt;/span&gt; &lt;span class="nf"&gt;securityFilterChain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;HttpSecurity&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;http&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;authorizeHttpRequests&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;auth&lt;/span&gt;
                &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;requestMatchers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/actuator/health"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;permitAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;anyRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;authenticated&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;httpBasic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Customizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;withDefaults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Security 6 also applies authorization to every dispatcher type. If a forward or error dispatch suddenly returns 403, look at &lt;code&gt;spring.security.filter.dispatcher-types&lt;/code&gt; before you loosen rules globally.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hibernate 6
&lt;/h3&gt;

&lt;p&gt;Boot 3.0 ships Hibernate 6.1 (later 3.x lines use later 6.x; let the BOM pick the version). Imports move to &lt;code&gt;jakarta.persistence&lt;/code&gt;. Expect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Implicit numeric ID sequences often become per-entity (for example &lt;code&gt;person_seq&lt;/code&gt;) rather than a shared &lt;code&gt;hibernate_sequence&lt;/code&gt;, and the default increment/allocation size is often 50. That can break inserts on an existing database. Check the &lt;a href="https://docs.hibernate.org/orm/6.0/migration-guide/" rel="noopener noreferrer"&gt;Hibernate 6 migration guide&lt;/a&gt; and, if you need a temporary bridge, the &lt;code&gt;hibernate.id.db_structure_naming_strategy&lt;/code&gt; setting.&lt;/li&gt;
&lt;li&gt;UUID mappings and JDBC types may change; compare column types in staging.&lt;/li&gt;
&lt;li&gt;Don't set &lt;code&gt;hibernate.dialect&lt;/code&gt; unless you have a reason — Hibernate 6 can resolve it.&lt;/li&gt;
&lt;li&gt;Native queries, Criteria usage, and custom &lt;code&gt;UserType&lt;/code&gt; / &lt;code&gt;AttributeConverter&lt;/code&gt; code are the usual breakage spots. Read the Hibernate guide for anything non-trivial.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Build plugins, Lombok, and Mockito
&lt;/h2&gt;

&lt;p&gt;If you use &lt;code&gt;spring-boot-starter-parent&lt;/code&gt; or the Boot Gradle plugin, plugin and dependency versions stay in sync. If you pin them yourself, bump them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set &lt;code&gt;java.version&lt;/code&gt; (or &lt;code&gt;maven.compiler.release&lt;/code&gt;) to 17, then 21 when you take that step.&lt;/li&gt;
&lt;li&gt;Check the &lt;a href="https://docs.spring.io/spring-boot/system-requirements.html" rel="noopener noreferrer"&gt;system requirements&lt;/a&gt; for your target Boot line. Boot 3.0 needed Maven 3.5+ and Gradle 7.5+; later 3.x lines need a newer Gradle.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lombok:&lt;/strong&gt; Java 21 needs Lombok 1.18.30 or newer. Don't leave a years-old pin in the POM.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mockito:&lt;/strong&gt; 5.x is what you want on Java 17 and 21. On Java 21, the JDK restricts dynamic agent attach; if tests warn or fail when Mockito instruments classes, attach &lt;code&gt;mockito-core&lt;/code&gt; as a &lt;code&gt;-javaagent&lt;/code&gt; in Surefire/Failsafe (see the current Mockito docs).&lt;/li&gt;
&lt;li&gt;Spring Framework 6.1+ (Boot 3.2+) no longer infers parameter names by parsing bytecode. Keep &lt;code&gt;-parameters&lt;/code&gt; on the compiler — the Boot parent already sets this; a custom compiler plugin config can drop it by accident.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Tests
&lt;/h2&gt;

&lt;p&gt;Do a full test run after each of the three main steps, not only at the end.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Security test configs that extended &lt;code&gt;WebSecurityConfigurerAdapter&lt;/code&gt; need the same &lt;code&gt;SecurityFilterChain&lt;/code&gt; rewrite.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;@SpringBootTest&lt;/code&gt; plus a changed default security filter can make previously open endpoints require auth in slices you didn't expect.&lt;/li&gt;
&lt;li&gt;Hibernate 6 can change generated SQL; tests that assert exact SQL or rely on implicit sequences will fail.&lt;/li&gt;
&lt;li&gt;Recompile test sources too. Stale &lt;code&gt;javax.*&lt;/code&gt; imports in &lt;code&gt;src/test&lt;/code&gt; are a classic miss.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. Docker image
&lt;/h2&gt;

&lt;p&gt;Run the app on the same major JDK you compile with. The official &lt;a href="https://hub.docker.com/_/eclipse-temurin" rel="noopener noreferrer"&gt;Eclipse Temurin&lt;/a&gt; images are a solid default:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt; eclipse-temurin:17-jre-jammy
&lt;span class="k"&gt;WORKDIR&lt;/span&gt; /app
&lt;span class="k"&gt;COPY&lt;/span&gt; target/app.jar app.jar
&lt;span class="k"&gt;ENTRYPOINT&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"java"&lt;/span&gt;, &lt;span class="s2"&gt;"-jar"&lt;/span&gt;, &lt;span class="s2"&gt;"/app/app.jar"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use &lt;code&gt;21-jre-jammy&lt;/code&gt; once you move the runtime to 21. Prefer a JRE image for the runtime stage; use a JDK image only in a build stage. Alpine is smaller, but only switch if you've checked native dependencies — some JDBC or libc-sensitive libraries prefer glibc images like Jammy.&lt;/p&gt;

&lt;p&gt;If you pass &lt;code&gt;--add-opens&lt;/code&gt; today, put those flags in the image entrypoint or your orchestrator JVM options so they don't exist only on a developer's laptop.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Rollout and verification
&lt;/h2&gt;

&lt;p&gt;Treat this as a production-risking release, not a library bump.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Staging with production-like data.&lt;/strong&gt; Compare schemas and a few representative queries before you enable Hibernate to "fix" anything. Watch ID generation and UUID column types especially.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Start up and read the logs.&lt;/strong&gt; Property-migrator warnings, &lt;code&gt;InaccessibleObjectException&lt;/code&gt;, leftover &lt;code&gt;javax&lt;/code&gt; &lt;code&gt;ClassNotFoundException&lt;/code&gt;, and Flyway or Liquibase failures show up here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hit the real paths.&lt;/strong&gt; Health and readiness, login, the authenticated API, file upload, scheduled jobs, and any SOAP or XML endpoints.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remove &lt;code&gt;spring-boot-properties-migrator&lt;/code&gt;&lt;/strong&gt; once properties are updated, and drop temporary &lt;code&gt;--add-opens&lt;/code&gt; that a library upgrade has made unnecessary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Canary or blue-green&lt;/strong&gt;, then watch error rates, GC, and latency. Hibernate 6's SQL can be better, but it is different; a hot query that changed shape is worth a look.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Only then consider Java 21.&lt;/strong&gt; On Boot 3.2 or later, bump &lt;code&gt;java.version&lt;/code&gt; to 21, update the Docker base image, and re-run the same verification. Virtual threads are available from Boot 3.2 with &lt;code&gt;spring.threads.virtual.enabled=true&lt;/code&gt;, but that's an optional follow-up, not part of the upgrade itself.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The work is mechanical more than mysterious, as long as you keep the order and verify after each step.&lt;/p&gt;

&lt;p&gt;If you'd rather hand this off, I do fixed-scope Java 17/21 and Spring Boot 3 upgrades on &lt;a href="https://www.fiverr.com/alphasolutionsw/upgrade-your-java-app-to-17-or-21-and-spring-boot-3" rel="noopener noreferrer"&gt;Fiverr&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>java</category>
      <category>springboot</category>
      <category>migration</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
