How to undeploy a portlet from Liferay 7? - maven

I am learning how to create portlets on Liferay 7 CE GA 3 portal platform.
For this, I created few test portlets using maven, gradle, by following the tutorials given in liferay site.
But now, I need to remove those portlets from the server. Whenever I start the tomcat server given inside Liferay's bundle, those previously deployed portlets comes up on the web page. I have tried but I can't find the war files deployed inside tomcat, in order to delete them.
I tried deleting the portlets folder inside work directory of liferay and also clearing the temp directory, but that didn't helped.
PS: I was manually deploying the portlets by copying the war file to 'deploy' directory of liferay bundle.

I'm using Liferay 7.0 DXP bundled with tomcat 8.
I tried deleting/deactivating deployed modules from Control Panel using Admin credentials. That just worked for me in that instance, but If I restart the server again these modules were deployed on the server startup.
The below solution worked for me with the above-mentioned configurations.
{LIFERAY_HOME}/osgi/modules -- jar modules
{LIFERAY_HOME}/osgi/war -- war modules
{LIFERAY_HOME}/osgi/marketplace -- any .lpkg files that were downloaded from Liferay's Marketplace

As you don't state the version of Liferay that you're using:
In 6.x, you'll find the WAR files (or web applications) wherever your application server deploys them - e.g. in tomcat/webapps. You only need to undeploy them from Tomcat (or your appserver) and they will also be undeployed from Liferay.
In 7.0 and DXP, those files will be deployed to the OSGi runtime and the artifacts end up in Liferay's /osgi/ folder, most likely /osgi/war - or if you package as JAR bundles in /osgi/modules (otherwise search for known filenames in /osgi subdirectories

Go to Liferay Control panel -> App Manager -> Search 'Your portlet' and then uninstall in Liferay 7.4

Related

Deploy Spring Boot project to WebSphere 8.5.5

I'm trying to deploy my spring boot project (made by spring initializr) with maven (but same issue with gradle) on WebSphere Application Server 8.5.5 but it seems impossible to me.
Every-time I try to add to server from "Add and Remove" it says "There are no resources that can be added or removed from the server".
So I tried changing Dynamic Web Module on Project properties --> project facets but nothing changed.
Is it possible to deploy on WAS 8.5.5?
I found a similar reported issue here: Cannot 'Add and Remove' Maven Project with Websphere 7 on RAD 8.5.
I completely removed my project from RAD. I then extracted zip file from Spring Initializr to create a Maven project. I used "mvnw eclipse:eclipse" command and it successfully created build. I imported that as a general project to RAD.
I then clicked on project. Clicked on properties. Clicked on project facets. None were available, but it prompted me to create them and I did. From there, I selected Dynamic Web Module facet (and also JAX-RS, but I'm not sure if you'll care about that one). I clicked apply and close.
After this, I was able to add and remove resource to Websphere server. I don't know if this is preferred steps or not. I am learning, just as you are. But, it appeared to work.
I specified Java 8 Jar in Spring Initializr for packaging. Maven version is 3.8.4. Spring Boot 2.6.5 (it was pre-selected for me). I am using RAD 9.7 and Websphere server that is stood up in IDE is version 8.5.5.
To deploy spring boot to WebSphere 9 you would want to choose War packaging and Java 8. The zip file from the spring initializr includes a Help.md file with links to helpful documentation. After you extract the zip file, use File -> Import existing maven project into a new workspace.

I can't see my WAR file in webapps folder of Tomcat

I can't see my WAR file in webapps folder of my Tomcat server directory.
My project is portal project and I am using Liferay portal technology hosted on Tomcat server.
For deploying, I am using Maven configured goal name 'deploy'.
When I deploy the portlet module it generated the war file and I can see the file in deploy folder of my Liferay server but when I start the tomcat server it should ideally generate/move WAR file in 'webapps' folder of tomcat server directory but it is not doing that.
I have tried multiple options like deleting and re-configuring the server, setting Dynamic web-module version to 3.0 from 2.5 (as suggested in one of the post at StackOverflow) but nothing works for me.
I am stuck in this issue for long time and any help will be a great help..
Thanks
I'm assuming that you're using Liferay 7 or Liferay DXP. As these versions are built on OSGi, they're transforming the WAR files into an OSGi bundle (so called WAB, Web Application Bundle) and do not deploy them to tomcat, as you observe.
Prior versions did this, but not the current one.
As you don't state what else you'd expect: This is your answer - you're right, it's not there.
If you don't use Liferay 7 or DXP: Elaborate.

Replacing/deploying only the changes in the already depolyed ear in Jboss 7

I am deploying the ear file each time when i making a changes as my project is multi-module and it is really tedious to upload/deployed the entire ear again in Jboss 7.Is there any way to replace only the changed jar/war/files in the already deployed ear in jboss without deploying the entire ear file again.
Thanks.
You should consider using JRebel - it allows reloading changes. After you compile any class it will automaticaly reload it, supporting modern frameworks (like reloading spring beans, etc) and application servers (JBoss included). It works as a java agent. You will find more details on producent site: http://zeroturnaround.com/software/jrebel/features/
To introduce JRebel in Maven project you just need to add jrebel-maven-plugin

IBM Worklight 6.0 - Deploying Worklight to external Apache Tomcat

I'm developing a Worklight (v6.0) application. I have added Tomcat server in Eclipse server perspective. With that I have deployed my application, and it is working fine.
I want know, how can we deploy our application in an external apache server? i.e without adding Tomcat server in Eclipse.
You need to have another instance of Apache Tomcat installed on your computer - simply download and extract it somewhere in your hard disk.
You need to then "install" to it the Worklight framework files and prepare databases based on your worklight.properties setup.
Then you need to simply deploy your project's .war file to it (can be found in the bin folder in your Worklight project), followed by deploying your .adapter files and application .wlapp files (also found in the bin folder).
Assuming you are an IBM Worklight customer, then after extracting Tomcat in your HD, you can and should use the IBM Installation Manager and Ant task scripts to handle the rest (deploying Worklight framework, setting up the database, deploying the .war file).
See this topic in the IBM Worklight 6.0 Information Center:
Installing Worklight Server
If you prefer to work manually...:
Deploying a project WAR file and configuring the application server manually
Note that the Worklight framework .jar file is available ONLY to customers of IBM Worklight.

How to deploy Liferay portlets using WAS Administration Console

After deploying Liferay war on WAS 7.0,
How to deploy any of the liferay plugins war?
I can deploy plugins war in a same way as I deployed Liferay portal war and it also shows that apllication is started and running but I can't see the portlet in Liferay's Add more option or any where.
Any Help is Appriciated.
Thanks.
You need to do it in two steps:
Copy the portlet WAR file into Liferay's autodeploy directory. Liferay will process the plugin configuration files and generate a new WAR into a destination directory.
Deploy this newly generated WAR using Websphere admin console.
The path where Liferay leaves the preprocessed WAR is configurable via the auto.deploy.* properties in the portal.properties file. Take a look there to see where to look for the file.

Resources