留言板

Liferay deployment and web.xml changes.

Manish Kharkar,修改在7 年前。

Liferay deployment and web.xml changes.

New Member 帖子: 24 加入日期: 14-12-8 最近的帖子
Hello,
We have a war file that has a single web.xml and multiple spring mvc portlets.
When we drop it into the deploy folder, Liferay converts the listener tags to a single context-param tag with param-name - portalListenerClasses.
It also adds several entries needed for the spring mvc portlet to work in Liferay.
Is there a way to do these changes to the web.xml before the deployment, say in the build phase?
We are trying the mvn liferay:deploy and direct-deploy as suggested in a few forums, but have not succeeded yet.
Regards,
Manish
Manish Kharkar,修改在7 年前。

RE: Liferay deployment and web.xml changes.

New Member 帖子: 24 加入日期: 14-12-8 最近的帖子
Hello All,
Here is how we got it to run.

Download the
Liferay 6.1.2 maven artifacts.
Install Apache Ant.
Install the maven artifacts in the local maven repository.
Create a file build.manish.properties in the maven artifact directory that contains the build.properties and build.xml.
Replace manish with correct username.
It should contain the following properties.
        gpg.keyname=
        gpg.passphrase=
        lp.maven.repository.id=
        lp.maven.repository.url=
        lp.version.maven=6.1.2

Run ant install command from the command prompt in the same folder.
There are 2 approaches that can be taken for executing direct-deploy.
1. Work on the already assembled war file to create the deployable war
Create the following folder structure.
prepareLiferay
[indent]deployable[/indent]
[indent]target[/indent] - Place the assembled war in this folder.
pom.xml
Sample pom.xml is attached.
Run the command
mvn liferay:direct-deploy
in the prepareLiferay folder. It creates an exploded war file in the deployable folder.

2. Modify the existing build process to create the deployable.
Modify the pom.xml of the war project to include the following plugin tag in the build tag.

			<plugin>
				<groupid>com.liferay.maven.plugins</groupid>
				<artifactid>liferay-maven-plugin</artifactid>
				<version>6.1.2</version>
				<executions>
					<execution>
						<phase>install</phase>
						<goals>
							<goal>direct-deploy</goal>
						</goals>
					</execution>
				</executions>
                <configuration>
					<autodeploydir>${liferay.auto.deploy.dir}</autodeploydir>
					<appserverdeploydir>${liferay.app.server.deploy.dir}</appserverdeploydir>
					<appserverlibglobaldir>${liferay.app.server.lib.global.dir}</appserverlibglobaldir>
					<appserverportaldir>${liferay.app.server.portal.dir}</appserverportaldir>
					<liferayversion>${liferay.version}</liferayversion>
					<plugintype>portlet</plugintype>
				</configuration>
			</plugin>

Add the following properties tag after the build tag.

   <properties> 
       <liferay.auto.deploy.dir>./deployable</liferay.auto.deploy.dir> 
       <liferay.version>6.1.2</liferay.version> 
       <liferay.maven.plugin.version>6.1.2</liferay.maven.plugin.version>
       <liferay.app.server.deploy.dir>./deployable</liferay.app.server.deploy.dir>
       <liferay.app.server.portal.dir>Path to the folder containing deployed Liferay. On tomcat this is ROOT within webapps folder.</liferay.app.server.portal.dir>
       <liferay.app.server.lib.global.dir>path to the lib folder of the tomcat instance.</liferay.app.server.lib.global.dir>
   </properties> 

Run
mvn clean install.

When the build is successful, the exploded war is created in the deployable folder.
Manish Kharkar,修改在7 年前。

RE: Liferay deployment and web.xml changes.

New Member 帖子: 24 加入日期: 14-12-8 最近的帖子
Hello All,
What is the preferred/recommended approach to production deployment for the Liferay portlets?
Even for the servers that support hot deployment, is direct-deploy approach recommended?
What are our clients using?
Regards,
Manish.
Manish Kharkar,修改在7 年前。

RE: Liferay deployment and web.xml changes.

New Member 帖子: 24 加入日期: 14-12-8 最近的帖子
Hello All,
Can we combine the layouts and themes in a single war?
What would be the plugin-type for such a project?
Regards,
Manish.