第一步、我們先去官網下載我們要用的東西
1.Eclipse
2.SDK
3.Tomcat
這是官網下載地址--》https://www.liferay.com/zh/downloads
下面是圖片說明
這是Eclipse下載說明
SDK下載圖片
Tomcat下載
官網只有最新的Tomcat所以我們去這個下載地址:https://sourceforge.net/projects/lportal/files/Liferay%20Portal/
第二步、在Eclipse上配置Liferay
先配置Tomcat
然后配置sdk
在這一步之后可能會出現兩個錯誤如果沒有出現不用理會。
錯誤一
Invalid SDK settings.Configure app.server.parent.dir property in build.Robbin.properties(這個就是下面新建的文件名) to point to Liferay home
解決方法:
在SDK目錄下面新建如下文件 這個文件名字就是上面標紅的文件名
文件內容如下里面的路徑根據自己的liferay Tomcat的路徑修改
#Managed by Liferay IDE (remove this comment to prevent future updates) #Sun Oct 09 15:13:19 CST 2016 app.server.tomcat.lib.global.dir=D\:\\Liferay\\liferay-portal-6.2-ce-ga4\\tomcat-7.0.42\\lib\\ext app.server.tomcat.deploy.dir=D\:\\Liferay\\liferay-portal-6.2-ce-ga4\\tomcat-7.0.42\\webapps app.server.parent.dir=D\:\\Liferay\\liferay-portal-6.2-ce-ga4 app.server.tomcat.dir=D\:\\Liferay\\liferay-portal-6.2-ce-ga4\\tomcat-7.0.42 app.server.type=tomcat app.server.tomcat.portal.dir=D\:\\Liferay\\liferay-portal-6.2-ce-ga4\\tomcat-7.0.42\\webapps\\ROOT
錯誤二
[Console output redirected to file:D:\Temp\.metadata\.plugins\com.liferay.ide.sdk.core\sdk.log] Buildfile: D:\Liferay\liferay-plugins-sdk-6.2\portlets\build.xml [get] Getting: http://mirrors.lax.liferay.com/cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar [get] To: C:\Users\Robbin\.liferay\mirrors\cdn.repository.liferay.com\nexus\content\repositories\liferay-snapshots-ce\com\liferay\org.apache.ivy\2.4.0.LIFERAY-PATCHED-1-SNAPSHOT\org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar [get] Error getting http://mirrors.lax.liferay.com/cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar to C:\Users\Robbin\.liferay\mirrors\cdn.repository.liferay.com\nexus\content\repositories\liferay-snapshots-ce\com\liferay\org.apache.ivy\2.4.0.LIFERAY-PATCHED-1-SNAPSHOT\org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar [get] Getting: http://cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar [get] To: C:\Users\Robbin\.liferay\mirrors\cdn.repository.liferay.com\nexus\content\repositories\liferay-snapshots-ce\com\liferay\org.apache.ivy\2.4.0.LIFERAY-PATCHED-1-SNAPSHOT\org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar BUILD FAILED D:\Liferay\liferay-plugins-sdk-6.2\portlets\build.xml:5: The following error occurred while executing this line: D:\Liferay\liferay-plugins-sdk-6.2\build-common-plugins.xml:5: The following error occurred while executing this line: D:\Liferay\liferay-plugins-sdk-6.2\build-common.xml:60: The following error occurred while executing this line: D:\Liferay\liferay-plugins-sdk-6.2\build-common-ivy.xml:130: The following error occurred while executing this line: D:\Liferay\liferay-plugins-sdk-6.2\build-common-ivy.xml:81: HTTP Authorization failure Total time: 1 second
解決方法:
Error getting http://mirrors.lax.liferay.com/cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
to
C:\Users\Robbin\.liferay\mirrors\cdn.repository.liferay.com\nexus\content\repositories\liferay-snapshots-ce\com\liferay\org.apache.ivy\2.4.0.LIFERAY-PATCHED-1-SNAPSHOT\org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
上面標紅的是報錯信息意思就是說從上面的地址下載org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar 然后放到下面的地址去。
我們試着用上面的地址發現根本打不開,然后我們又來試
http://cdn.repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/com/liferay/org.apache.ivy/2.4.0.LIFERAY-PATCHED-1-SNAPSHOT/org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
這個地址也打不開。
我們就直接使用https://repository.liferay.com這個地址 搜索內容 org.apache.ivy
這是百度網盤地址:org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar--->鏈接: http://pan.baidu.com/s/1nvjQeCD 密碼: nekb
如果沒有配置MAVEN,可以按照下圖方式進行下載
下載下載放到提示的目錄就可以了,我的目錄是:
C:\Users\Robbin\.liferay\mirrors\cdn.repository.liferay.com\nexus\content\repositories\liferay-snapshots-ce\com\liferay\org.apache.ivy\2.4.0.LIFERAY-PATCHED-1-SNAPSHOT\org.apache.ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar
然后再次上面配置SDK的步驟,會彈出一個框要等很長時間。
如果還是報錯或者很慢就使用下面的方法。
在SDK目錄下新建.ivy如果有了就不建了。
在.ivy里面放【ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar】和 cache
ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar是我們剛才下載的。
cache 這個文件它會自動生成。這是百度網盤下載地址---》鏈接: http://pan.baidu.com/s/1qY71DFm 密碼: djt3
接下來就是成功的圖片了
結束:第二個錯誤還行網上有解決方法,第一個錯誤我在網上找了一圈好象沒有人遇到,所以解決起來有點費時所以在這兒記錄一下。