Skip to content

Upgrade Java 6 to Java 11 with Dropwizard 2.1.12#27

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

Upgrade Java 6 to Java 11 with Dropwizard 2.1.12#27
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1775673629-upgrade-java-6-to-11

Conversation

@devin-ai-integration
Copy link
Copy Markdown

Summary

Upgrades the DropwizardEmployee application from Java 6 to Java 11, including a major Dropwizard framework bump from 1.0.5 to 2.1.12.

Build changes (pom.xml):

  • Decoupled Dropwizard BOM version from ${project.version} and pinned to 2.1.12; added dropwizard-dependencies BOM
  • maven-compiler-plugin 3.6.0 → 3.13.0 with <release>11</release> (replaces <source>1.6</source>/<target>1.6</target>)
  • maven-surefire-plugin 2.19.1 → 3.2.5
  • maven-shade-plugin 2.4.3 → 3.6.0 with module-info.class exclusion for uber-JAR compatibility

Source changes:

  • EmployeeConfiguration.java: @NotEmpty import moved from deprecated org.hibernate.validator.constraints to javax.validation.constraints
  • EmployeeDAO.java: Added unchecked cast on namedQuery() return to Query<Employee> to satisfy Dropwizard 2.x's stricter Hibernate generics
  • AppTest.java: Migrated from JUnit 3 (TestCase) to JUnit 5 (Jupiter @Test)

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

Review & Testing Checklist for Human

  • Verify runtime startup: The test suite is trivially minimal (one assertTrue(true)). Manually run java -jar target/DropwizardEmployee-1.0.5.jar server example.yml with Java 11 and confirm the app boots, Hibernate initializes, and /employee endpoints respond correctly.
  • Validate the unchecked cast in EmployeeDAO.findAll(): The namedQuery()Query<Employee> cast is standard but suppresses a type-safety warning. Confirm the named query Employee.findAll returns the expected entity type at runtime.
  • Check for Dropwizard 1.x → 2.x behavioral differences: This is a major framework version jump that pulls in Hibernate 5.6.x, Jetty 9.4.53, Jackson 2.13.x, and Jersey 2.41. Review any downstream consumers or deployment configs that may depend on 1.x behavior.

Notes

  • The Dropwizard BOM was previously tied to ${project.version} (1.0.5), coupling framework version to artifact version. This PR decouples them so the project version remains 1.0.5 while Dropwizard is at 2.1.12.
  • Shade plugin warnings about overlapping META-INF resources across dependencies are benign (LICENSE/NOTICE files).

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

- Update maven-compiler-plugin to 3.13.0, use <release>11</release>
- Upgrade Dropwizard BOM from 1.0.5 to 2.1.12
- Add dropwizard-dependencies BOM import
- Update maven-surefire-plugin to 3.2.5
- Update maven-shade-plugin to 3.6.0, add module-info.class exclusion
- Fix @notempty import: org.hibernate.validator.constraints -> javax.validation.constraints
- Fix EmployeeDAO.findAll() typing for Dropwizard 2.x Hibernate API
- Migrate test from JUnit 3 to JUnit 5 (Jupiter)

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