MainServlet中,初始化公司信息之后就是初始化插件了,对应代码如下:


  1.     if (_log.isDebugEnabled()) { 
  2.             _log.debug("Initialize plugins"); 
  3.         } 
  4.  
  5.         try { 
  6.             initPlugins(); 
  7.         } 
  8. .. 

 

它会去调用initPlugins方法:


  1. protected void initPlugins() throws Exception { 
  2.  
  3.         // See LEP-2885. Don't flush hot deploy events until after the portal 
  4.         // has initialized. 
  5.  
  6.         if (SetupWizardUtil.isSetupFinished()) { 
  7.             HotDeployUtil.setCapturePrematureEvents(false); 
  8.  
  9.             PortalLifecycleUtil.flushInits(); 
  10.         } 
  11.     } 

 

这里很简单,只要进行SetupWizardUtil.isSetupFinished的判断:


  1. public static boolean isSetupFinished() { 
  2.         if (PropsValues.SETUP_WIZARD_ENABLED) { 
  3.             return _setupFinished; 
  4.         } 
  5.  
  6.         return true
  7.     } 

这个方法会先去判断是否开启了setup向导,这个值写在portal.properties文件中:


  1.    # Set this property to true if the Setup Wizard should be displayed the 
  2.    # first the portal is started. 
  3.    # 
  4.    setup.wizard.enabled=true 

从这里看出,默认portal第一次启动会启动向导,所以isSetupFinished()返回的是_setupFinished的值,也就是false。

 

所以我们不执行07-09行的代码。

 

现在,Liferay的启动过程就算正式完成了。