How to undeploy a Liferay Portal 6 EXT Plugin

Overview

Liferay Portal 6 supports six plugin types for customizing and extending the base product :

  • Portlets
  • Hooks
  • Themes
  • Layouts
  • EXT
  • Web

For many extension cases, portlets, hooks, themes and layouts are sufficient to help you customize Liferay Portal.

However, occassionally you will need to extend or replace one or more pieces of core functionality, which is only possible using an EXT (extension) plugin.

One issue that arises when using EXT plugins is removing them to ensure a clean re-deployment or removing them when no longer required.

Unfortunately, undeploying an EXT plugin is not as simple as undeploying a portlet or hook plugin. The EXT plugin affects multiple runtime files during deployment.

Loutilities posted a very simple and effective MS DOS-based script for undeploying EXT plugins which I have used and am sharing here.

Please refer to the references section below for links to details on EXT plugin development.

Please refer to the appendix for a BASH-based script for undeploying EXT plugins.

References

Appendix - Clean My EXT Plugin BASH Script

#!/bin/sh

####
##
## Purpose: Simple script to purge EXT plugin resources from Liferay Portal 6.x installation.
##
## Caveats: This script comes with no warranty whatsoever. 
##          Review before using and use at your own risk.
##
## Usage: clean-my-ext-plugin.sh 
##
## @author Loutilities "http://en.gravatar.com/loutilities"
## @author Tim Telcik "tim.telcik@permeance.com.au"
##
## @created: 31-July-2013
##
## @see http://loutilities.wordpress.com/2010/12/06/how-to-undeploy-liferay-6-ee-ext-plugin/
##
####

if [ $# -ne 1 ]; then
 echo "Usage: clean-my-ext [ext-name]"
 exit 1
fi

tomcat_home="./tomcat"
app_name="$1"

rm -rf $tomcat_home/temp/*
rm -rf $tomcat_home/work/*
rm -rf $tomcat_home/webapps/$app_name-ext
rm -rf $tomcat_home/webapps/ROOT/html/portlet/ext
rm -f $tomcat_home/lib/ext/ext-$app_name-ext-service.jar
rm -f $tomcat_home/webapps/ROOT/WEB-INF/lib/ext-$app_name-ext-util-bridges.jar
rm -f $tomcat_home/webapps/ROOT/WEB-INF/lib/ext-$app_name-ext-util-taglib.jar
rm -f $tomcat_home/webapps/ROOT/WEB-INF/lib/ext-$app_name-ext-util-java.jar
rm -f $tomcat_home/webapps/ROOT/WEB-INF/lib/ext-$app_name-ext-impl.jar
rm -f $tomcat_home/webapps/ROOT/WEB-INF/ext-$app_name-ext.xml
rm -f $tomcat_home/webapps/ROOT/WEB-INF/tiles-defs-ext.xml

 

0