liferay Developer Mode

终于找到官方的文档,一般的搜索引擎好像搜索不到lifeary developer mode,囧,之前一直想要切换到开发模式,但是不知道如何切换,看完之后其实很简单。

开启后可以调试前端JS,这个很有用的,呵呵



Do you want to develop Liferay resources without having to redeploy to see your portal modifications? Use Liferay Developer Mode! In Developer mode all caches are removed, so any changes you make are visible right away. You won’t have to reboot the server as often if you use Developer Mode.
Before you use Developer Mode, you’ll have to add the portal-developer.properties file to your application server’s configuration file. Each application server has a different configuration file or UI to specify system properties. Let’s demonstrate using Tomcat application server.


In your setenv.sh file (setenv.bat in Windows), find the line setting the JAVA_OPTS variable and add the following to the list of options:


`Dexternal-properties=portal-developer.properties` 
The following is an example of the JAVA_OPTS variable lines with your code included:


JAVA_OPTS="-Xms256m -Xmx1024m -XX:PermSize=32m -XX:MaxPermSize=160m -Dfile.encoding=UTF8 -Duser.timezone=GMT+2 -Djava.security.auth.login.config=$CATALINA_HOME/conf/jaas.config -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Dexternal-properties=portal-developer.properties"


Tip: If you’re already using the system property external-properties to load other properties files, add portal-developer.properties to the list and use a comma to separate it from other entries.

How does Developer Mode let you see your changes more quickly? In Developer Mode, there are several changes to the normal order of operations:

- CSS files are loaded individually rather than being combined and loaded as a single CSS file.  - JavaScript files are also loaded individually, including JavaScript for the portal itself and JavaScript related to any portlet registered through `liferay-portlet.xml`. JavaScript logs are also enabled in Developer Mode.  - Modification-based caching of web resources is disabled.  - Velocity Templates for themes and journal articles are not cached, so changes will be applied immediately. 

Individual file loading of your styling and behaviors, combined with disabled caching for web resources and Velocity Templates, let’s you see your changes more quickly when operating in Developer Mode.

Now, when you modify your theme’s custom.css file directly in your Liferay Bundle, you can see your changes applied as you make them! Make sure you copy any changes you make back into your _diffs folder, or they’ll be overwritten when you redeploy your theme.

Let’s add a thumbnail image for our theme now.



原文地址:

https://www.liferay.com/zh/about-us/newsroom/press-releases?p_p_auth=1z9Slj9I&p_p_id=101&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_101_struts_action=%2Fasset_publisher%2Fview_content&_101_assetEntryId=24615482&_101_type=content&_101_urlTitle=lp-6-1-theme-developer-mode&redirect=https%3A%2F%2Fwww.liferay.com%2Fzh%2Fcommunity%2Fwiki%3Fp_p_id%3D3%26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26_3_keywords%3Ddeveloper%2Bmode%26_3_struts_action%3D%252Fsearch%252Fsearch

你可能感兴趣的:(liferay Developer Mode)