GuicedEE CDI is a lightweight bridge that integrates Google Guice modules with Jakarta CDI runtimes. Use it when you need Guice’s module ergonomics alongside CDI-managed beans and scopes.
- Bridge Guice bindings into CDI-managed applications
- Discover Guice modules via ServiceLoader and/or JPMS providers
- Co-existence of scopes and interceptors where supported by the host environment
- Small surface area; keep your DI clean and modular
<dependency>
<groupId>com.guicedee</groupId>
<artifactId>guiced-cdi</artifactId>
</dependency>
// 1) Provide your Guice module
public final class MyModule extends com.google.inject.AbstractModule {
@Override protected void configure() {
bind(Greeter.class).to(DefaultGreeter.class);
}
}
// 2) Register via ServiceLoader (META-INF/services)
// file: META-INF/services/com.guicedee.client.IGuiceModule
// com.example.MyModule
// 3) Start your CDI container
// The bridge exposes Guice bindings to CDI consumers when your app boots.
- Register Guice modules via
META-INF/servicesand/or JPMSprovides ... with .... - Logging and environment toggles live in your host app; the bridge itself is configuration-light.
- In hybrid stacks (Servlet/JAX-RS/Vert.x), ensure only one container owns lifecycle; others integrate via SPI.
- JPMS-friendly; dual-register services for portability (ServiceLoader + module-info.java).
- If you export Guice modules as services, add
provides com.guicedee.client.IGuiceModule with ....
@jakarta.enterprise.context.ApplicationScoped
public class WelcomeResource {
@jakarta.inject.Inject Greeter greeter; // bound from MyModule
public String hello(String name) { return greeter.greet(name); }
}
- Pact:
PACT.md - Rules:
RULES.md - Guides:
GUIDES.md - Glossary:
GLOSSARY.md - Architecture index:
docs/architecture/README.md
- Issues/PRs welcome. Keep docs in sync with changes (forward-only policy).
- Align terminology with the topic glossaries referenced from
GLOSSARY.md.
- Apache License 2.0 — see
LICENSE.