How to have a Guice module use another Guice module?

Noel Yap picture Noel Yap · Aug 20, 2011 · Viewed 14.3k times · Source

Let's say I have a Guice module ProdModule that I would like to depend on other GuiceModules, ProdDbModule and ProdPubSubModule. How would I implement ProdModule's configure()?

Answer

Jeremy picture Jeremy · Aug 20, 2011

You would install your other modules

protected void configure(){
    install(new ProdDbModule());
    install(new ProdPubSubModule());
    // etc.
}