Support for loading Guice modules from /lib
Gerrit already has "pluggable" features that need to be installed
at the early stages of the bootstrap phase and cannot be "unplugged"
as plugins do.
Attendees at the recent hackathon in Mountain View decided to
call this new entities "LibModules", and configure them in the
gerrit.config as follows:
[gerrit]
installModule = com.googlesource.gerrit.libmodule.MyModule
installModule = com.example.abc.OurSpecialSauceModule
Change-Id: Id8bf1a2e88b14c8e9125f20cb10a041d47799100
This commit is contained in:
committed by
Shawn Pearce
parent
8e5418db0a
commit
62cc3503b9
@@ -24,6 +24,7 @@ import com.google.gerrit.lifecycle.LifecycleModule;
|
||||
import com.google.gerrit.metrics.DisabledMetricMaker;
|
||||
import com.google.gerrit.metrics.MetricMaker;
|
||||
import com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker;
|
||||
import com.google.gerrit.server.LibModuleLoader;
|
||||
import com.google.gerrit.server.config.GerritServerConfig;
|
||||
import com.google.gerrit.server.config.GerritServerConfigModule;
|
||||
import com.google.gerrit.server.config.SitePath;
|
||||
@@ -180,6 +181,7 @@ public abstract class SiteProgram extends AbstractProgram {
|
||||
modules.add(new SchemaModule());
|
||||
modules.add(cfgInjector.getInstance(GitRepositoryManagerModule.class));
|
||||
modules.add(new ConfigNotesMigration.Module());
|
||||
modules.addAll(LibModuleLoader.loadModules(cfgInjector));
|
||||
|
||||
try {
|
||||
return Guice.createInjector(PRODUCTION, modules);
|
||||
|
||||
Reference in New Issue
Block a user