一直想研究一下Liferay,最近終于有時間開始行動了,在myeclipse上搭建開發環境及Debug折騰了兩天,終于搞定了。
tomcat-5.5.17
liferay-portal-src-4.1.3
一、在Eclipse中Import liferay-portal-src-4.1.3
????????????修改.classpath 添加
?<classpathentry excluding="com/" kind="src" path="counter-ejb/classes"/>
?<classpathentry excluding="com/" kind="src" path="documentlibrary-ejb/classes"/>
?<classpathentry excluding="com/" kind="src" path="mail-ejb/classes"/>
?<classpathentry excluding="com/" kind="src" path="lock-ejb/classes"/>
?<classpathentry excluding="com/" kind="src" path="portal-ejb/classes"/>
?<classpathentry excluding="com/" kind="src" path="portal-kernel/classes"/>
?<classpathentry excluding="com/" kind="src" path="util-bridges/classes"/>
?<classpathentry excluding="com/" kind="src" path="util-java/classes"/>
?<classpathentry excluding="com/" kind="src" path="util-taglib/classes"/>
?<classpathentry excluding="com/" kind="src" path="util-wsrp/classes"/>
二、在Eclipse中新建一個Web Project? (root),將liferay-portal-src-4.1.3\portal-web中的文件導入到root/web中,設置liferay-portal-src-4.1.3為required project(或者把liferay-portal-src-4.1.3的輸出直接設到web project的輸出上),并且加入liferay-portal-src-4.1.3的lib.
?????????修改Web Context-root為 / ,加入index.html,修改Web.xml,在src中添加portal-ext.properties(覆蓋portal.properties中的值,liferay中可以用ext來擴充配置),liferay-portal-src-4.1.3\definitions中的內容copy到src/com.liferay.portal.definitions中
添加com.liferay.portal.deploy.dependencies及其中的文件(變態的用到了util-*.jar三個,hotdeploy有用到,目前還不知道清楚有什么用)。
三、Eclipse配置tomcat?
???????????optional java vm arguments中需要添加-Xms128m -Xmx512m -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djava.security.auth.login.config=%TOMCAT_HOME%conf/jaas.config
四、tomcat的修改
????????添加?%tomcat_home%/conf/jaas.config,添加%tomcat_home%/conf/Catalina/localhost/ROOT.xml
????????修改%tomcat_home%/conf/catalina.properties——common.loader中添加${catalina.home}/common/lib/ext/*.jar(還要添加ext這個目錄copy進需要添加的jar)
?????????修改?%tomcat_home%/bin/catalina.bat 加入set JAVA_OPTS=-Xms128m -Xmx512m -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djava.security.auth.login.config=%CATALINA_HOME%/conf/jaas.config
現在應該可以用于開發了,只是liferay編譯一下下要多等會了,哪個不是一般的慢呀(機子也實在太爛).
順便說下,debug了一下,個人感覺liferay的性能應該不會太理想,Spring用的也蠻古怪的,Factory中也用了事務。對liferay中spring的用法感覺也不是太好(也有點)。——個人觀點(水平有限,有錯的地方多多指教)