Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Cameron McBride
Best way to redeploy ext plugins?
March 10, 2011 6:35 PM
Answer

Cameron McBride

Rank: Expert

Posts: 273

Join Date: February 8, 2011

Recent Posts

The various documentation on re-deploying an ext plugin confuses me a bit. It seems like the documentation wants you to blow the entire <liferay> directory away and place a brand new copy out there, forcing you to replace all your config files, plugins, etc out there.

What I have been doing in my prototype testing is:
1. Shut down liferay
2. Delete the ext plugin directory from webapps
3. Place my new war file in the deploy directory
4. Start up liferay
5. At this point the old ext is still loaded and the new war file is deployed
6. Shut down and start up liferay
7. New changes are in place

Is there a better method?

Thanks!
Milen Dyankov
RE: Best way to redeploy ext plugins?
March 10, 2011 9:59 PM
Answer

Milen Dyankov

Rank: Regular Member

Posts: 173

Join Date: September 23, 2009

Recent Posts

What I have been doing during development is:
1ant direct-deploy
Thiago Leão Moreira
RE: Best way to redeploy ext plugins?
March 11, 2011 5:59 AM
Answer

Thiago Leão Moreira

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1400

Join Date: October 10, 2007

Recent Posts

Hey Milen, that is the right way to go.
David H Nebinger
RE: Best way to redeploy ext plugins?
March 11, 2011 8:13 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 8590

Join Date: September 1, 2006

Recent Posts

The issue for the ext plugin is the way it gets deployed by the auto-deployer...

What the various docs say is that during deployment, any files that the ext plugin replaces in the base LR are renamed in base, then the ext plugin files are put in their place. Restarting the application container is necessary to make sure that the non-runtime-replaceable files (i.e. files in WEB-INF) are correctly loaded.

Undeployment of the ext plugin does the opposite; removes the files from base that were copied in, restore the original files from base, then the restart of the application container so the original non-runtime-replaceable files are loaded and used.

I think that redeployment of the ext plugin is the possible point of failure. Say in your first ext deployment you overrode a jsp file. When deployed, the original would be renamed and your jsp goes in. You then remove the jsp in your ext project and re-deploy...

What the doco suggests is that there is the possibility that during deployment, your overridden jsp page is not removed and the original jsp page is not restored. This could lead to an inconsistent environment where there is a mix of no longer needed overridden jsp files and no original files restored.

I'm not saying I've seen this happen or think that it actually does happen this way, but that's what the doco is suggesting.

That is why there is the push to start w/ a clean Liferay ROOT in your webapps dir, to ensure that any hiccups in the redeployment process are resolved.

But Thiago is right in that for the most part it should be okay to use the 'ant deploy' to deploy your ext plugin. If you do notice weird things, then falling back to a clean Liferay and then deploy your ext plugin may help to resolve them.
Cameron McBride
RE: Best way to redeploy ext plugins?
March 11, 2011 8:39 AM
Answer

Cameron McBride

Rank: Expert

Posts: 273

Join Date: February 8, 2011

Recent Posts

I am deploying this to a liferay server that does not have the plugins sdk, ant or much of anything else on it.

Being a liferay noob the long explanation was way above my head. Exactly which directories is it recommended that I remove and place out there fresh for each deployment of a ext plugin?

Thanks!
David H Nebinger
RE: Best way to redeploy ext plugins?
March 11, 2011 9:22 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 8590

Join Date: September 1, 2006

Recent Posts

Primarily all you would need to do prior to the initial ext plugin deployment would be:
  1. stop the application server.
  2. copy the webapps/ROOT directory somewhere.
  3. start the application server.
Then you can deploy your ext plugin. If you need to re-deploy the ext plugin, stop the application server, delete the webapps/ROOT directory and your ext plugin directory, and copy the original ROOT back into webapps. That way you're starting w/ a clean ROOT.

But I think you would only need to do this if you think there may be a problem w/ the normal ext deployment process which, AFAIK, have not been reported.
Cameron McBride
RE: Best way to redeploy ext plugins?
March 11, 2011 2:14 PM
Answer

Cameron McBride

Rank: New Member

Posts: 6

Join Date: February 21, 2011

Recent Posts

Two easy follow up questions to removing the ROOT directory.

I have added a few files into ROOT/classes like portal-ext.properties, system-ext.properties and content\Language-etc.properties.

1. Should I move all of those properties files into my ext plugin?

2. Will the billion other files in ROOT be automatically regenerated?
SZ khan
RE: Best way to redeploy ext plugins?
March 11, 2011 3:32 PM
Answer

SZ khan

Rank: Regular Member

Posts: 148

Join Date: October 31, 2009

Recent Posts

My steps to redeploy ext-plugin

1. Shut down the server
2. ant direct-deploy
3. Start the server

It worked for me.

In addition to this, there is another method to redeploy ext-plugin

1. Shut down the server
2. ant clean-app-server
2. ant direct-deploy
3. Start the server
Mauro Mariuzzo
RE: Best way to redeploy ext plugins?
March 13, 2011 6:44 AM
Answer

Mauro Mariuzzo

Rank: Regular Member

Posts: 140

Join Date: July 23, 2007

Recent Posts

I think we have 2 use cases:
  • development time redeploy
  • production redeploy


During development the best way to redeploy extlet plugins is:
  • shutdown tomcat (or JBoss, etc.)
  • ant direct-deploy
  • restart tomcat
  • redeploy portlets/hooks/themes that needs new extlet features


It's better to re-create your liferay insallation (with ant clean-app-server):
  • when you remove jsp from your extlet (because with direct deploy you loose the original jsp)
  • if you have to make final tests, before deploy you software on production server



For production enviroment you can find some suggestions on the Liferay Administration guide.

The worst part of the "standard" procedure is that you have to restart the server (tomcat, jboss, etc.) two times.

We have developed an utility and a script file that is able to apply and extlet taking a backup of the original files, allowing a safe extlet update with only 1 restart.

Take a look on LPS-14769
Cameron McBride
RE: Best way to redeploy ext plugins?
March 14, 2011 7:10 AM
Answer

Cameron McBride

Rank: Expert

Posts: 273

Join Date: February 8, 2011

Recent Posts

For local laptop development I am using eclipse and I am never having to do anything manually. This includes deploying an ext plugin. I assume that eclipse is handling all of it for me. ext does require a restart of the server in eclipse.

Production (non local laptop) deployment is what I'm most interested in. We do not have ant on the machine.

Each time I delete ROOT and redeploy the ext and all my portlets I am going to also have to place all my custom property files out there as well (portal-ext, system-ext, etc). Is that what everyone is doing?
Tomas Polesovsky
RE: Best way to redeploy ext plugins?
March 22, 2011 2:11 PM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 598

Join Date: February 13, 2009

Recent Posts

Hi,

maybe it helps you: http://issues.liferay.com/browse/LPS-14221

-- tom
Vipin Bardia
RE: Best way to redeploy ext plugins?
October 8, 2013 11:06 PM
Answer

Vipin Bardia

Rank: Regular Member

Posts: 125

Join Date: February 27, 2011

Recent Posts

Hi Cameron,

These links can help you -

http://www.apoorvaprakash.in/2012/02/redeployment-of-ext.html
http://www.apoorvaprakash.in/2012/08/automated-undeployment-of-ext.html