Migrate from http4k 5.x to 6.x

http4k Core http4k Connect

About http4k versioning

http4k follows a strict 4-point semantic versioning policy:

A.B.C.D

where…

  • A = Major version - breaking changes and deprecation removals
  • B = Breaking version - breaking API or behavioral changes
  • C = Enhancement version - new features and library updates
  • D = Patch version - bug fixes

This means that we intend to only introduce breaking changes in the A and B releases. This allows users to predictably upgrade at their own pace in the knowledge that they will not encounter any unexpected breaking changes.

The migration from v5 to v6 is a A release, which means that there are breaking changes. We suggest the following method:

  1. Look carefully at the list of breaking changes between your current version and the latest http4k version in the CHANGELOG so you have some scope of the task.
  2. Ensure that your code is covered by tests, run your build!
  3. Upgrade your minimum Java version to 21, as per the new minimum Java version. If you still require access to security upgrades for Java 8-20 support, please see details of our LTS programme available in http4k Enterprise Edition.
  4. Upgrade your http4k dependencies to the latest v5 release - this is v5.47.0.0.
  5. Deal with any deprecations - each change should have an “replace with” that can be applied using the IDE.
  6. Migrate any module coordinate changes in the v5 release. You can refer to the module migration guide below.
  7. Run your build!
  8. Upgrade to the latest v6x.x.x release.
  9. Deal with any further deprecations and breaking changes. Most of these are likely to be in the form of repackaging, so should be easy to fix.
  10. Run your build one last time.
  11. Celebrate!

If you have any need of migration support from the http4k team, please feel free to get in touch or ask in the http4k Slack channel.

Module migration

As a part of the V6 release, several modules have been rehoused to new Maven coordinates within http4k Community edition (and retaining the Apache2 license). In preparation, we have introduced these modules to late version of v5 to give users the time to migrate without taking on-board other breaking changes from v6 .

SOURCE MODULE - v5.X.X.XDESTINATION MODULE(S) - v6.X.X.X
http4k-awshttp4k-platform-aws
http4k-azurehttp4k-platform-azure
http4k-cloudeventshttp4k-api-cloudevents
http4k-cloudnativeSplit into http4k-config, http4k-platform-core, http4k-platform-k8s
http4k-contracthttp4k-api-openapi
http4k-contract-jsonschemahttp4k-api-jsonschema
http4k-contract-ui-redochttp4k-api-ui-redoc
http4k-contract-ui-swaggerhttp4k-api-ui-swagger
http4k-failsafehttp4k-ops-failsafe
http4k-gcphttp4k-platform-gcp
http4k-graphqlhttp4k-api-graphql
http4k-htmxhttp4k-web-htmx
http4k-jsonrpchttp4k-api-jsonrpc
http4k-metrics-micrometerhttp4k-ops-micrometer
http4k-opentelemetryhttp4k-ops-opentelemetry
http4k-resilience4jhttp4k-ops-resilience4j