Skip to content

Migrate from Java 6 to Java 11 with Dropwizard 2.1.12#32

Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1776965380-java11-migration
Open

Migrate from Java 6 to Java 11 with Dropwizard 2.1.12#32
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1776965380-java11-migration

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Apr 23, 2026

Summary

Migrates the project from Java 6 / Dropwizard 1.0.5 to Java 11 / Dropwizard 2.1.12. This is a major framework upgrade touching build configuration, dependency management, source compatibility, and test infrastructure.

Build & Dependencies (pom.xml)

  • Decoupled Dropwizard BOM version from ${project.version} into a <dropwizard.version> property set to 2.1.12
  • Added dropwizard-dependencies BOM import alongside the existing dropwizard-bom
  • Added explicit JAXB/Jakarta dependencies (jakarta.xml.bind-api, jaxb-runtime, jakarta.activation-api) with versions pinned in <dependencyManagement> to satisfy dependency convergence
  • Updated compiler plugin from source/target 1.6 to release 11
  • Updated all Maven plugin versions (surefire 2.19.1→3.1.2, shade 2.4.3→3.5.1, compiler 3.6.0→3.11.0, etc.)
  • Added module-info.class exclusion in shade plugin filter

Source Changes

  • EmployeeConfiguration.java: @NotEmpty import moved from deprecated org.hibernate.validator.constraints to javax.validation.constraints
  • EmployeeDAO.java: Added explicit cast of namedQuery() result to Query<Employee> for Dropwizard 2.x Hibernate API compatibility
  • AppTest.java: Migrated from JUnit 3 (junit.framework) to JUnit 5 (org.junit.jupiter)

Config & Docs

  • Updated ALPN comment in example.yml (Java 11 has native ALPN support)
  • Updated README.md to reference Dropwizard 2.1.12 and Java 11

mvn clean install passes on JDK 11.

Review & Testing Checklist for Human

  • Verify the DAO unchecked cast is safe at runtime: EmployeeDAO.findAll() casts namedQuery() result from Query<?> to Query<Employee>. This compiles and passes the trivial test suite, but should be verified with actual database operations (POST an employee, then GET the list).
  • H2 database compatibility: Dropwizard 2.1.12's BOM pulls H2 2.2.x (up from ~1.4.x). H2 2.x has breaking changes in SQL mode and URL handling. Run java -jar target/DropwizardEmployee-1.0.5.jar db migrate example.yml then start the server and exercise the CRUD endpoints.
  • JAXB version convergence: jaxb-runtime is pinned to 2.3.3 in dependencyManagement, overriding Hibernate 5.6.15's transitive 2.3.1. Verify no runtime ClassNotFoundException or NoSuchMethodError from Hibernate's XML binding paths.
  • Smoke test the running application: mvn package && java -jar target/DropwizardEmployee-1.0.5.jar server example.yml — verify the app boots on port 8080, POST/GET /employee work, and admin on 8081 responds.

Notes

  • The existing test suite is trivial (assertTrue(true)) and provides no meaningful coverage of the migration. Manual smoke testing is essential.
  • The project version remains 1.0.5 (only the Dropwizard framework version was upgraded). The jar filename in the README still references DropwizardEmployee-1.0.5.jar which is correct.

Link to Devin session: https://app.devin.ai/sessions/557bb933cbe84da99855f70a1ff44c29
Requested by: @WesternConcrete


Open in Devin Review

- Upgrade Dropwizard BOM from 1.0.5 to 2.1.12, decoupling project version
- Add dropwizard-dependencies BOM import
- Add JAXB/Jakarta dependencies managed in dependencyManagement for convergence
- Update all Maven plugin versions for Java 11 compatibility
- Update maven-compiler-plugin to use release 11 instead of source/target 1.6
- Fix @notempty import: org.hibernate.validator.constraints -> javax.validation.constraints
- Fix EmployeeDAO namedQuery typing for Dropwizard 2.x Hibernate API
- Migrate test from JUnit 3 to JUnit 5 (Jupiter)
- Update example.yml ALPN comment (Java 11 has native ALPN support)
- Update README to reflect Dropwizard 2.1.12 and Java 11 requirement
- Add module-info.class exclusion in shade plugin filter

Co-Authored-By: Wes Convery <2wconvery@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant