Bootstrap boot = context.getBean(Bootstrap.class); boot.start();
public void startBootstrapInstance(MavenPluginContext pluginContext) { this.log = pluginContext.getLog(); this.configuration = pluginContext.getConfiguration(); List<Stoppable> stoppables = Lists.newArrayList(); getSetupStepSequence().execute(pluginContext); PrintStream originalSystemErr = System.err; bootstrap = getBootstrap(); log.info("Starting Tomcat ..."); try { File catalinaout = new File(configuration.getCatalinaBase(), "/logs/catalina.out"); CatalinaOutPrintStream catalinaOutputStream = new CatalinaOutPrintStream(originalSystemErr, new FileOutputStream(catalinaout), configuration.isSuspendConsoleOutput()); System.setErr(catalinaOutputStream); bootstrap.init(); final BootstrapShutdownHook shutdownHook = new BootstrapShutdownHook(); List<Stoppable> stoppableScanner = ScannerSetup.configureScanners(shutdownHook, configuration, log); stoppables.addAll(stoppableScanner); bootstrap.start(); Runtime.getRuntime().addShutdownHook(shutdownHook); log.info("Tomcat started"); } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } stoppables.add(new StoppableBootstrapAdapter(bootstrap)); pluginContext.getMojo().getPluginContext().put(AbstractT7BaseMojo.T7_BOOTSTRAP_CONTEXT_ID, stoppables); }