Skip to content

Upgrade Java 6 to Java 11 with Dropwizard 2.1.12#20

Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1775196979-upgrade-java6-to-java11
Open

Upgrade Java 6 to Java 11 with Dropwizard 2.1.12#20
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1775196979-upgrade-java6-to-java11

Conversation

@devin-ai-integration
Copy link
Copy Markdown

Summary

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

Build config (pom.xml):

  • Decoupled Dropwizard BOM from ${project.version} (was 1.0.5) → pinned to 2.1.12; added dropwizard-dependencies BOM
  • Compiler: <source>1.6</source>/<target>1.6</target><release>11</release> (plugin 3.6.0 → 3.13.0)
  • Surefire: 2.19.1 → 3.2.5 (required for Java 11 module handling + JUnit 5 support)
  • Shade: 2.4.3 → 3.6.0; added module-info.class exclusion to prevent conflicts in uber JAR

Source changes:

  • EmployeeConfiguration.java: @NotEmpty import moved from org.hibernate.validator.constraintsjavax.validation.constraints (old annotation removed in newer Hibernate Validator)
  • EmployeeDAO.java: Added explicit cast of namedQuery() result to Query<Employee> — Dropwizard 2.x's namedQuery() returns Query<?> instead of raw Query, breaking the list() call
  • AppTest.java: Migrated from JUnit 3 (TestCase/TestSuite) to JUnit 5 (@Test/Assertions) — JUnit 3 classes are no longer on the classpath with Dropwizard 2.x

Verified locally: mvn clean verify passes (compile + test + uber JAR) with OpenJDK 11.0.30.

Review & Testing Checklist for Human

  • Run the app end-to-end on Java 11: java -jar target/DropwizardEmployee-1.0.5.jar server example.yml — verify it starts, GET /employee returns [], and POST /employee creates records. The existing test (assertTrue(true)) provides zero functional coverage.
  • Verify the EmployeeDAO unchecked cast: The @SuppressWarnings("unchecked") cast from Query<?> to Query<Employee> is a pragmatic fix but suppresses type safety. Confirm the named query executes correctly at runtime.
  • Dropwizard 1.x → 2.x behavioral differences: This is a major framework version jump. Transitive dependencies changed substantially (Jetty, Jersey, Hibernate, Jackson versions all bumped). Verify no runtime surprises with serialization, DB sessions, or HTTP handling.

Notes

  • No removed Java EE modules (javax.xml.bind, javax.xml.ws, etc.) were used in the codebase, so no standalone replacements were needed.
  • No CI config, Dockerfiles, or JVM flag scripts existed in the repo, so no updates were needed there.
  • The shade plugin warnings about overlapping resources in the uber JAR are expected and benign (duplicate LICENSE/NOTICE files from transitive deps).

Link to Devin session: https://app.devin.ai/sessions/177575b9a7c647a59b27a22c9e8cd928
Requested by: @wavecreator1

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

Co-Authored-By: Siddhant Seghal <siddxs5@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

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.

0 participants