Skip to content

Upgrade Java 6 to Java 11 with Dropwizard 2.1.12 (AB-183)#28

Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1775679224-upgrade-java-6-to-11
Open

Upgrade Java 6 to Java 11 with Dropwizard 2.1.12 (AB-183)#28
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1775679224-upgrade-java-6-to-11

Conversation

@devin-ai-integration
Copy link
Copy Markdown

Summary

Upgrades the DropwizardEmployee project from Java 6 to Java 11, including a Dropwizard framework upgrade from 1.0.5 to 2.1.12 and all Maven plugin version bumps.

Key changes:

  • Java: <source>1.6</source>/<target>1.6</target><release>11</release>
  • Dropwizard: 1.0.5 → 2.1.12 (decoupled BOM version from ${project.version}, added dropwizard-dependencies BOM)
  • @NotEmpty import: org.hibernate.validator.constraints.NotEmptyjavax.validation.constraints.NotEmpty (old import removed in Hibernate Validator 6.x)
  • EmployeeDAO.findAll(): Added explicit cast to Query<Employee> to satisfy Hibernate 5.x's stricter generics on AbstractDAO.list()
  • Test migration: JUnit 3 (TestCase) → JUnit 5 (Jupiter), since Dropwizard 2.x ships JUnit 5
  • Shade plugin: Added module-info.class exclusion to prevent conflicts in uber-JAR
  • All Maven plugins bumped to current versions (shade 3.6.0, surefire 3.2.5, compiler 3.13.0, etc.)

mvn clean verify passes with zero compilation errors and all tests green.

Review & Testing Checklist for Human

  • Verify the app starts and serves requests. The only test is assertTrue(true) — CI passing does NOT validate runtime behavior. Run java -jar target/DropwizardEmployee-1.0.5.jar server example.yml and hit GET /employee and POST /employee to confirm the Dropwizard 2.x upgrade didn't break request handling or Hibernate session management.
  • Review the unchecked cast in EmployeeDAO.findAll() — the @SuppressWarnings("unchecked") cast from Query<?> to Query<Employee> is a common Hibernate 5 pattern but masks potential type errors. Consider whether a typed CriteriaQuery approach would be safer long-term.
  • Confirm @NotEmpty validation behavior is unchangedjavax.validation.constraints.NotEmpty should behave identically to the old Hibernate-specific one, but verify that the template and defaultName fields in EmployeeConfiguration still reject blank values on startup.

Notes

  • The Dropwizard version jump (1.0.5 → 2.1.12) is large. While the codebase is small and compiles cleanly, there may be subtle behavioral changes in Jetty, Jersey, or Hibernate session handling that only surface at runtime.
  • Jira: AB-183

Link to Devin session: https://app.devin.ai/sessions/c00be4a91f574eef82605444f7c817ff
Requested by: @pqn

- Update maven-compiler-plugin to 3.13.0 with <release>11</release>
- Upgrade Dropwizard BOM from 1.0.5 to 2.1.12
- Add dropwizard-dependencies BOM import
- Upgrade all Maven plugins to Java 11 compatible versions:
  - maven-shade-plugin 2.4.3 -> 3.6.0
  - maven-surefire-plugin 2.19.1 -> 3.2.5
  - maven-enforcer-plugin 1.4.1 -> 3.4.1
  - maven-clean-plugin 2.6.1 -> 3.1.0
  - maven-install-plugin 2.5.2 -> 3.1.1
  - maven-resources-plugin 2.7 -> 3.3.1
  - maven-source-plugin 2.4 -> 3.3.0
  - maven-jar-plugin 2.6 -> 3.3.0
  - maven-deploy-plugin 2.8.2 -> 3.1.1
  - maven-site-plugin 3.4 -> 3.12.1
- Add module-info.class exclusion to shade plugin filters
- Fix @notempty import: hibernate-validator -> javax.validation
- Fix EmployeeDAO.findAll() typing for Hibernate 5.x Query API
- Migrate test from JUnit 3 to JUnit 5 (Jupiter)
- Add project.build.sourceEncoding UTF-8 property

Jira: AB-183
Co-Authored-By: prem@cognition.ai <prem@cognition.ai>
@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

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