Liferay学习笔记(一)Liferay Portal5.2.3环境的初步搭建
Liferay Portal5.2.3 环境的初步搭建 一、 准备工作 1、 开发包 目前 Liferay 官网 http://www.liferay.com/zh/home 上只提供最新版本的 liferay 包下载,下载 5.2.3 版本需要到开源社区 http://sourceforge.net/projects/lportal/files/Liferay%20Portal/
Liferay Portal5.2.3环境的初步搭建
一、 准备工作
1、 开发包
目前Liferay官网http://www.liferay.com/zh/home上只提供最新版本的liferay包下载,下载5.2.3版本需要到开源社区http://sourceforge.net/projects/lportal/files/Liferay%20Portal/,选择5.2.3版本下载下面两个包:
Portal源码包:liferay-portal-src-5.2.3.zip
Tomcat捆绑包:liferay-portal-tomcat-6.0-5.2.3.zip
2、 开发工具
开发工具 建议版本 本文使用版本
JDK 1.6以上 1.6.0_22
Ant 1.7以上 1.8.2
MyEclipse 5.5以上 7.5
Tomcat 6.0以上 6.0.18
注意:这里的Tomcat是liferay-portal-tomcat捆绑包中的tomcat,所以不需要再另外下载;Ant到http://ant.apache.org/bindownload.cgi下载最新的apache-ant-1.8.2.bin.zip
3、 目录结构
本文假设操作目录结构如下:
D:/workspace 根目录
D:/workspace/ant ant的安装目录
D:/workspace/Liferay liferay工作目录
D:/workspace/Liferay/portal liferay-portal源代码目录
D:/workspace/Liferay/service liferay-portal捆绑Tomcat的目录
D:/workspace/Liferay/ext liferay-portal的扩展项目目录
二、 基础配置
1、JDK的安装配置
JDK的安装配置和以前一样,这里不再赘述,提醒一下安装配置完成别忘了使用“java -version”和“javac”来检查是否安装成功
2、Ant的安装配置
解压缩apache-ant-1.8.2.bin.zip到D:/workspace/ant目录下,在环境变量(Windows7下右键点击“计算机”后选择“高级系统设置—>高级—>环境变量”)中为Path系统变量新增如下路径:“D:/workspace/ant/apache-ant-1.8.2/bin;”,保存。
打开dos,输入“ant -version”检查配置是否正确
3、Tomcat的安装配置
解压缩liferay-portal-tomcat-6.0-5.2.3.zip到D:/workspace/Liferay/service目录下,在环境变量的Path系统变量中新增如下路径:“D:/workspace/Liferay/service/tomcat-6.0.18/bin;”,保存。
运行tomcat的startup.bat,服务器正常启动说明安装成功
4、MyEclipse的安装配置
这里只说一下MyEclipse中Tomcat服务器的配置。
将MyEclipse中Tomcat配置为第3步中安装的Tomcat,将Tomcat下的JDK配置为第1步中安装的JDK,并为JDK配置虚拟机参数如下:
-Xmx1024m -XX:MaxPermSize=256m -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djava.security.auth.login.config="%CATALINA_HOME%/conf/jaas.config" -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
提示:打开tomcat的bin目录下的setenv.bat文件,找到名为JAVA_OPTS的变量,其参数值即为需要copy的虚拟机参数。这个步骤非常重要,否则会导致内存溢出。
三、 建立开发环境
方法一:
1、 部署Liferay源码
将liferay-portal-src-5.2.3.zip解压缩到D:/workspace/Liferay/portal目录下
2、 新建配置文件release.${username}.properties
找到portal源码中的release.properties文件,在同目录下新建release.${username}.properties文件。${username}为本机的用户名,可以在dos下使用set命令查看username的值。我的机器username值为Administrator,故新建release.Administrator.properties文件,文件内容只有一行:
lp.ext.dir=D:/workspace/Liferay/ext
注:lp.ext.dir为Liferay指定扩展项目的目录,注意路径中必须使用“/”而不是“/”。
3、 生成扩展目录
运行dos,进入D:/workspace/Liferay/portal目录下,输入“ant clean start build-ext”命令执行,等待ant执行完成(需要3到10分钟)后,在Liferay的ext目录下会出现下列文件:
4、 新建配置文件app.server.${username}.properties
在ext目录下新建app.server.Administrator.properties文件,添加如下内容:
app.server.type=tomcat
app.server.tomcat.dir=D:/workspace/Liferay/service/tomcat-6.0.18
注:app.server.type为Liferay指定服务器类型,app.server.tomcat.dir为Liferay指定Tomcat服务器的安装目录。
5、 执行配置
打开dos,进入D:/workspace/Liferay/ext目录下,输入“ant clean deploy”命令执行,等待ant执行完成。
6、 开发环境建立完毕。
方法二:
1、 同方法一的步骤1
2、 同方法一的步骤2
3、 在与release.properties文件同目录下新建app.server.Administrator.properties文件,内容和方法一的步骤4文件内容一样。
4、 找到与release.properties文件同目录下的build.xml文件,找到下图中的节点:
并在该节点下新增子节点fileset,内容如下:
5、同方法一的步骤3,不同的是执行完后生成的ext目录下多了一个名为app.server.Administrator.properties的文件
6、同方法一的步骤5
7、 开发环境建立完毕。
四、 测试开发环境
运行startup.bat启动tomcat服务器,一段时间后会弹出一个登录网页,默认用户名为:test@liferay.com;密码:test;登录即进入Liferay Portal账户,可以对Portlet进行定制。
注:如果修改了后台数据库文件里的用户信息,则需要换一个Admin身份的用户进行登录,具体用户信息请查阅数据库。这里谢谢一楼nwpubin的提醒^_^
五、 环境搭建完成。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











How to delete Xiaohongshu notes? Notes can be edited in the Xiaohongshu APP. Most users don’t know how to delete Xiaohongshu notes. Next, the editor brings users pictures and texts on how to delete Xiaohongshu notes. Tutorial, interested users come and take a look! Xiaohongshu usage tutorial How to delete Xiaohongshu notes 1. First open the Xiaohongshu APP and enter the main page, select [Me] in the lower right corner to enter the special area; 2. Then in the My area, click on the note page shown in the picture below , select the note you want to delete; 3. Enter the note page, click [three dots] in the upper right corner; 4. Finally, the function bar will expand at the bottom, click [Delete] to complete.

Windows Recovery Environment (WinRE) is an environment used to repair Windows operating system errors. After entering WinRE, you can perform system restore, factory reset, uninstall updates, etc. If you are unable to boot into WinRE, this article will guide you through fixes to resolve the issue. Unable to boot into the Windows Recovery Environment If you cannot boot into the Windows Recovery Environment, use the fixes provided below: Check the status of the Windows Recovery Environment Use other methods to enter the Windows Recovery Environment Did you accidentally delete the Windows Recovery Partition? Perform an in-place upgrade or clean installation of Windows below, we have explained all these fixes in detail. 1] Check Wi

No more need for pip? Come and learn how to uninstall pip effectively! Introduction: pip is one of Python's package management tools, which can easily install, upgrade and uninstall Python packages. However, sometimes we may need to uninstall pip, perhaps because we wish to use another package management tool, or because we need to completely clear the Python environment. This article will explain how to uninstall pip efficiently and provide specific code examples. 1. How to uninstall pip The following will introduce two common methods of uninstalling pip.

As a Xiaohongshu user, we have all encountered the situation where published notes suddenly disappeared, which is undoubtedly confusing and worrying. In this case, what should we do? This article will focus on the topic of "What to do if the notes published by Xiaohongshu are missing" and give you a detailed answer. 1. What should I do if the notes published by Xiaohongshu are missing? First, don't panic. If you find that your notes are missing, staying calm is key and don't panic. This may be caused by platform system failure or operational errors. Checking release records is easy. Just open the Xiaohongshu App and click "Me" → "Publish" → "All Publications" to view your own publishing records. Here you can easily find previously published notes. 3.Repost. If found

How to add product links in notes in Xiaohongshu? In the Xiaohongshu app, users can not only browse various contents but also shop, so there is a lot of content about shopping recommendations and good product sharing in this app. If If you are an expert on this app, you can also share some shopping experiences, find merchants for cooperation, add links in notes, etc. Many people are willing to use this app for shopping, because it is not only convenient, but also has many Experts will make some recommendations. You can browse interesting content and see if there are any clothing products that suit you. Let’s take a look at how to add product links to notes! How to add product links to Xiaohongshu Notes Open the app on the desktop of your mobile phone. Click on the app homepage

Learn Pygame from scratch: complete installation and configuration tutorial, specific code examples required Introduction: Pygame is an open source game development library developed using the Python programming language. It provides a wealth of functions and tools, allowing developers to easily create a variety of type of game. This article will help you learn Pygame from scratch, and provide a complete installation and configuration tutorial, as well as specific code examples to get you started quickly. Part One: Installing Python and Pygame First, make sure you have

The Charm of Learning C Language: Unlocking the Potential of Programmers With the continuous development of technology, computer programming has become a field that has attracted much attention. Among many programming languages, C language has always been loved by programmers. Its simplicity, efficiency and wide application make learning C language the first step for many people to enter the field of programming. This article will discuss the charm of learning C language and how to unlock the potential of programmers by learning C language. First of all, the charm of learning C language lies in its simplicity. Compared with other programming languages, C language

When editing text content in Word, you sometimes need to enter formula symbols. Some guys don’t know how to input the root number in Word, so Xiaomian asked me to share with my friends a tutorial on how to input the root number in Word. Hope it helps my friends. First, open the Word software on your computer, then open the file you want to edit, and move the cursor to the location where you need to insert the root sign, refer to the picture example below. 2. Select [Insert], and then select [Formula] in the symbol. As shown in the red circle in the picture below: 3. Then select [Insert New Formula] below. As shown in the red circle in the picture below: 4. Select [Radical Formula], and then select the appropriate root sign. As shown in the red circle in the picture below:
