Skip to main content
Ligero

ligero

The lightweight Java web framework โ€” a micro-framework's speed and footprint, with the batteries the micro-frameworks leave out.

~13kreq/s
0.43ย scold start
3ย MBdependencies
0core deps
โšก Virtual threads by default๐Ÿชถ Zero-dependency core๐Ÿ”Œ Everything is a pluggable adapter๐Ÿงญ DI + modules, no reflection๐Ÿ”ฌ Visual devtools๐Ÿ›ก๏ธ Secure by default๐Ÿš€ GraalVM-friendly

Why Ligero

Ligero (Spanish for lightweight) is a web framework for Java 21+ that proves you don't have to choose between fast and lean and productive. On the zero-dependency JDK engine it tops a same-app benchmark โ€” ~13k req/s, ~0.43 s cold start, a 3 MB dependency tree โ€” while shipping a DI container, feature modules, a visual debugger, JPA/Redis integrations and more.

Ligero app = Ligero.create(8080);

app.get("/hello/{name}", ctx ->
ctx.json(Map.of("message", "Hello, " + ctx.pathParam("name") + "!")));

app.start(); // running in ~0.4 s

Built around a few firm ideas:

  1. Zero dependencies in the core โ€” ligero-core depends only on slf4j-api. JSON, server engines, templates, metrics, config, data โ€” every one is an optional, pluggable adapter behind an SPI. Pay only for what you use.
  2. Virtual threads by default โ€” blocking, easy-to-read handler code that scales like async, courtesy of Project Loom.
  3. No runtime magic โ€” no classpath scanning, no reflection-based injection. Wiring is explicit code the compiler checks; an optional annotation processor can generate it for you at compile time if you prefer brevity.
  4. Batteries, but ร  la carte โ€” a DI container, feature modules, a visual devtools dashboard, auth, OpenAPI, templates, tracing, JPA and Redis โ€” each a module you add when you need it, never weight you carry by default.

What's in the boxโ€‹

Everything below is optional โ€” add the module, or don't.

AreaModule(s)What you get
HTTP coreligero-corerouter, middleware, Context, SPIs, config โ€” zero deps
Enginesligero-server-jdk ยท ligero-server-jettyzero-dep JDK engine or Jetty (HTTP/2, WebSockets) โ€” swap in one line
DIligero-core (Beans) ยท ligero-processorexplicit lambda wiring, or generate it at compile time
Modulesligero-core (LigeroModule)feature slices, wiring out of the startup class
Devtoolsligero-devtools/ligero/dev โ€” bean graph + live per-request traces
Dataligero-jdbc ยท ligero-jpa ยท ligero-migrationsSQL โ†’ records (no ORM), a thin JPA/Hibernate helper, and Flyway migrations at startup
Validationligero-validationannotation-based request validation โ†’ automatic 400
Configligero-config-yamlligero.yml + profiles, ${ENV:-default}
Scale-outligero-redisdistributed rate-limit + session stores
Alsoauth ยท JSON ยท templates (ร—3) ยท OpenAPI ยท metrics ยท OTel tracingJWT/CSRF/sessions, Jackson, Mustache/FreeMarker/Pebble, โ€ฆ

See the full list on the Modules reference.

When to use Ligeroโ€‹

  • REST APIs and microservices where startup time and footprint matter.
  • Services that want plain, debuggable Java instead of framework magic.
  • Anywhere you'd reach for a micro-framework but still want DI, modules and first-class devtools.

When not to use itโ€‹

If you need the full Jakarta EE surface or Spring's ecosystem breadth (reactive stacks, the vast starter/integration catalog), use those โ€” Ligero optimizes for the lean, explicit end of the spectrum.

How it comparesโ€‹

Same products CRUD app, measured identically (see Benchmarks):

Ligero (JDK engine)JavalinSpring Boot
Core dependencies0 (slf4j-api)Jettydozens
Programming modelhandlers + middleware, explicit DIhandlersannotations + DI
Virtual threadsdefaultoptionaloptional
Cold start~0.43 s~0.62 s~2 s
Throughput~13k req/s~11k~5.8k
Dependency size3 MB8 MB20 MB

Ready to dive in? Start with the Quickstart, or follow the Learning Path for a guided route from your first route to a production service.