I stumbled on Google's auto-service project the other day, which made me dislike the SPI pattern less. You'd annotated your Guice modules with auto-service's @AutoService(Module.class) annotation. That generates a META-INF/services/com.google.inject.Module at compile time for the annotated class.
So... rather than compose an application via Maven dependencies, and manually adding each dependency's modules into the injector like:
final Injector injector = Guice.createInjector(
new ExampleModule(),
new ConfigModule(new File(args[0]), ExampleConfig.class),
new LoggingModule(),
new RestModule(),
new HibernateModule(),
new MetricsModule());
injector.getInstance(Run.class).start();
You'd compose the application via Maven, then to get all the default Modules loaded into your injector, you'd do something like:
final Injector injector = Guice.createInjector(
new ExampleModule(),
new ConfigModule(new File(args[0]), ExampleConfig.class),
GwizardModuleLoader.loadModules()
);
// start services
injector.getInstance(Run.class).start(); // if you depend on gwizard-services
It still has lots of rough edges. And... I'm not sure I like it. But, thought I'd throw it out to see if there's interest