Important: This news article covers an old version of Javalin (v3.9.0). The current version is v6.1.3.
See the documentation page for up-to-date information.

Multi module

Thanks to chsfleury, Javalin is now a multi-module project. The available modules are

  • javalin - the standard Javalin dependency, just as before
  • javalin-bundle - javalin, javalin-openapi, jackson and logback
  • javalin-openapi - the OpenAPI plugin and all required dependencies
  • javalin-graphql - the new GraphQL plugin (thanks to 7agustibm)
  • javalin-without-jetty - javalin with all jetty dependencies excluded and Jetty specific methods removed (useful for running on e.g. Tomcat)

The modules themselves can be considered stable, but which dependencies they pull in might change.

New Micrometer plugin

The Micrometer team wrote a new implementation for the Micrometer plugin, which according to them is on par with their Spring Boot integration. The previous implementation was very minimal.

Static file improvements

  • You can now pass a path-prefix to static files (config.addStaticFiles("/hosted-path", "/directory"))
  • You can now pre-compress static files by setting config.precompressStaticFiles = true. This will store your compressible static files as highly compressed bytearrays (in memory), and will ensure that content-length is always set (thanks to vn7n24fzkq)

Validator improvements

Thanks to thibaultmeyer and MrThreepwood the Validator API is a lot more flexible. You can now get a list showing all errors (if there were multiple errors) so you can form a nicer response to the client.

Misc fixes and improvements

  • Fixed OpenAPI annotations for fields (thanks to RalphSteinhagen)
  • Fixed JSON escaping of title during HttpException mapping (thanks to krig)
  • Added an exception for restarting a stopped server (thanks to ashwinbhaskar)
  • Made CORS plugin more strict (check full origin, not just startsWith) (thanks to Jerbell)