This recepie describes how to install Liferay on JBoss AS 7. I didn't suceed with Liferay 6.0.x but instead had to use the trunk checked out from svn. Please note that the trunk is work in progress and changing heavily so sometimes it's not possible to build it.
1. Check out the sourcecode from svn trunk
2. Build by issuing the following commands:
mkdir dist
ant jars
ant -f build-dist.xml zip-portal-war zip-portal-dependencies
2. Download Jboss AS 7.0.1 and unpack it
3. Create a folder $JBOSS_HOME/modules/com/liferay/portal/main
5. Unpack the content of the liferay-portal-dependencies-6.1.0.jar from dist to this folder. It will contain the files hsql.jar, portal-service.jar and portlet.jar.
6. Create a file in this folder called module.xml with the following content:
1<?xml version="1.0"?>
2<module xmlns="urn:jboss:module:1.0" name="com.liferay.portal">
3 <resources>
4 <resource-root path="hsql.jar" />
5 <resource-root path="portal-service.jar" />
6 <resource-root path="portlet.jar" />
7 </resources>
8 <dependencies>
9 <module name="javax.api" />
10 <module name="javax.mail.api" />
11 <module name="javax.servlet.api" />
12 <module name="javax.servlet.jsp.api" />
13 <module name="javax.transaction.api" />
14 </dependencies>
15</module>
7. Unpack the content of liferay-portal-6.1.0.war to $JBOSS_HOME/standalone/deployments/liferay-portal-6.1.0.war to create an exploded deployment. This directory will be refered to as $PORTAL_HOME below
8. Create an empty file $JBOSS_HOME/standalone/deployments/liferay-portal-6.1.0.war.dodeploy
9. Create a file called jboss-deployment-structure.xml in $PORTAL_HOME/WEB-INF with the following content:
1<?xml version="1.0"?>
2<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
3 <deployment>
4 <exclusions>
5 <module name="org.hibernate" />
6 </exclusions>
7 <dependencies>
8 <module name="com.liferay.portal" />
9 <module name="javax.mail.api" />
10 <module name="org.apache.xerces" />
11 <module name="org.jboss.modules" />
12 <module name="system" export="false">
13 <imports>
14 <include path="com/sun/jmx"/>
15 <exclude path="/**" />
16 </imports>
17 </module>
18 </dependencies>
19 </deployment>
20</jboss-deployment-structure>
10. Delete $PORTAL_HOME/WEB-INF/lib/eclipselink.jar
11. Create a file $PORTAL_HOME/WEB-INF/classes/portal-ext.properties with the following content:
liferay.home=${jboss.home.dir}/liferay
resource.repositories.root=${liferay.home}
12. Edit $JBOSS_HOME/standalone/configuration/standalone.xml, change the following entries:
Change
1<deployment-scanner scan-interval="5000" relative-to="jboss.server.base.dir" path="deployments" />
to
1<deployment-scanner name="default" path="deployments" scan-enabled="true" scan-interval="5000" relative-to="jboss.server.base.dir" deployment-timeout="240"/>
Change
1<virtual-server name="default-host" enable-welcome-root="true">
to
1<virtual-server name="default-host" enable-welcome-root="false">
Add to security-domains section:
1 <security-domain name="PortalRealm">
2 <authentication>
3 <login-module code="com.liferay.portal.security.jaas.PortalLoginModule" flag="required"/>
4 </authentication>
5 </security-domain>
13. Done, you should now be able to start jboss and go to http://localhost:8080/
Por favor, faça login para denunciar.