Deploying Liferay Plugins in Liferay on Oracle Weblogic 12c running in "Production" mode

I am thinking of what to write for my first blog. Since I have just been asked on how to deploy a Liferay plugin in Liferay on Oracle Welogic 12c Application Server, I am thinking I may as well document my findings here so that the information is not lost. However, the steps mentioned here does not apply for some types of plugin especially Liferay Hooks and, of course, Extension.

Based on Liferay Product Documentation (https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/deploying-your-plugins-hot-deploy-vs-auto-deploy), there are times when Application servers running in “production” and “domain” modes only support non-exploded WAR deployments. To package your developed Liferay Plugins in a manner which can be deployed using the deployment features of the supported application servers, “ant direct-deploy” can be used.

An extract from the Documentation link above which provides the details:

" The Liferay Plugins SDK allows you to preprocess your archives and inject all the required elements. You therefore bypass the auto deployer at runtime. You simply need to call the following Ant task:

ant direct-deploy 

The direct-deploy Ant task creates an exploded WAR from which you can easily create a WAR file. The location of the exploded WAR depends on the deployment directory of the application server you’ve configured in your Plugins SDK environment. See the Developing with the Plugins SDK tutorials for instructions on configuring the Plugins SDK for your app server. The Plugins SDK’s build.properties provides a default deployment directory value for each supported app server. But you can override the default value by specifying your desired value for theapp.server.[type].deploy.dir (replace [type] with your app server type) in your build.[username].propertiesfile.

If you choose not to use the Liferay Plugins SDK to do direct deployment, you can examine the build-common.xml file in the Plugins SDK to see how Liferay invokes the deployer tools."

Based on my recent exploration with Oracle Weblogic 12c (v12.2.1) Application Server, here are the high level steps in configuring and creating a fully deployable Liferay Plugin which can be deployed using the deployment feature of Oracle Weblogic.

Step 1: Configure Liferay SDK build.<user>.properties in your Build (e.g. Development) Machine where Oracle WebLogic (with Liferay installed) is running in “Development” mode.

For shortcut on how to make Oracle WebLogic run in “Development” mode, please refer to (http://www.baigzeeshan.com/2011/06/how-to-change-weblogic-domain-mode-to.html). 

For more details on how to install Liferay in Oracle WebLogic, please refer to (https://dev.liferay.com/discover/deployment/-/knowledge_base/6-2/installing-liferay-on-oracle-weblogic-12c-12-1-2-and-h)

For more details on configuring Liferay SDK, please refer to (https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/setting-up-the-plugins-sdk)

For a sample settings, please refer to (https://github.com/liferay/liferay-plugins/blob/master/build.properties)

In this example, I am using the followings which is tuned to my environment:

app.server.type=weblogic

app.server.parent.dir=C:\\Oracle\\Middleware\\Oracle_Home

app.server.weblogic.dir=${app.server.parent.dir}\\user_projects

app.server.weblogic.deploy.dir=${app.server.weblogic.dir}\\domains\\base_domain\\autodeploy

app.server.weblogic.lib.global.dir=${app.server.weblogic.dir}\\domains\\base_domain\\lib

app.server.weblogic.portal.dir=${app.server.weblogic.dir}\\domains\\base_domain\\autodeploy\\ROOT

Step 2: Execute “ant direct-deploy” in your Build Machine

Once executed successfully, you will see your plug-in “deployed” in “exploded” WAR in the “autodeploy” directory under the configured domain (specified in the settings in step1) of Oracle Weblogic Application Server. Once done, jar/zip up your exploded WAR with a name. To make it in sync with the naming convention of Liferay plugin, mine is named “liferay-workshop-layout-layouttpl.war” (Liferay layout plugin) as shown below.

You may also append a version like this “liferay-workshop-layout-layouttpl-6.2.10.1.war”

Step 3: Deploy this WAR file to your Runtime Machine (different from your Build Machine) where Oracle WebLogic (with Liferay installed) is run in “Production” mode.

Once deployed successfully using the deployment feature of Oracle Weblogic 12c, you will see the deployed packaged as show below

Step 4: Validate that the plugin is available in your Runtime Machine after deployment is successful as shown below

Disclaimer: The post here mainly describes my exploration of the topic mentioned. It may not represent the recommended approach.