serviceTarget.addListener(ServiceListener.Inheritance.ALL, bootstrapListener);
final File[] extDirs = serverEnvironment.getJavaExtDirs();
final File[] newExtDirs = Arrays.copyOf(extDirs, extDirs.length + 1);
newExtDirs[extDirs.length] = new File(serverEnvironment.getServerBaseDir(), "lib/ext");
serviceTarget.addService(org.jboss.as.server.deployment.Services.JBOSS_DEPLOYMENT_EXTENSION_INDEX,
new ExtensionIndexService(newExtDirs)).setInitialMode(ServiceController.Mode.ON_DEMAND).install();
// Activate module loader
DeployerChainAddHandler.addDeploymentProcessor(Phase.STRUCTURE, Phase.STRUCTURE_SERVICE_MODULE_LOADER, new DeploymentUnitProcessor() {
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {