How to deploy a portlet to Liferay from Eclipse - eclipse

I've made a portlet in Eclipse and now I'd like to deploy it to a running Liferay-6.1 instance and debug it. I guess this should be described in documentation, but I was only able to found how to create the portlet, but not how to deploy it.

Here is a screenshot which shows how-to deploy Liferay portlet directly from Eclipse

How to deploy a portlet in Eclipse (using Liferay IDE) is documented here. This assumes that you have installed Liferay IDE, then created a Liferay Server adapter, and then created a project using New Liferay Project wizard.

After completion of developing the portlet go to the browser open the localhost sign in and then-->Goto Add--->more-->expand the sample--->Select Add

You can deploy it by using command prompt. Go to location of your plugin portlet and execute the following command:
eg:
D:\Projects\plugin\portlets\test-portlet>ant deploy
Note: you need to configure ant home like this.

If you have a plugin project, but you need to deploy it onto your Liferay Server. Let’s do it now:
Select your new plugin project then right click the Liferay Server in the Servers tab;
Select Add and Remove….
Select your plugin project and click Add to deploy it to the server.
Click Finish.
You should see the project get deployed to Liferay Tomcat server; in the console you’ll see a message indicating your new portlet is available for use.

Related

Not able to create Liferay Plugin Project in Eclipse

I am new to liferay and i am trying to create a new Liferay Plugin Project.
I did a right click on package explorer and clicked on 'New Liferay Plugin Project'.
After that i entered the Project and Display name then i selected the Liferay MVC as my portlet framework and i clicked finish.
As soon i click on finish, it shows "Error creating Liferay Plugin Project: Please see eclipse error log for the details".
After this i changed ivy.jar.url in build.properties file from "http://repo1.maven.org/maven2/org/apache/ivy/ivy/2.3.0/ivy- 2.3.0.jar"
to "=C:\Rahul13615\liferay\plugins.ivy\ivy-2.3.0.jar".
I did and still i am getting the same error.
Maybe it's not exact answer to your question, but for Liferay 6.2 development I recommend using Apache Maven 3 as build tool.
Download Maven separately https://maven.apache.org/ and install.
Then at command line run command (https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/creating-liferay-maven-plugins-from-the-command-lin)
mvn archetype:generate -DarchetypeCatalog=https://repository.liferay.com/nexus/content/groups/liferay-ce
and choose desired plugin through wizard.
After that import that project as an Maven project to Eclipse IDE.
As you mentioned that you are new to Liferay development I recommend offical Liferay documentation but instead of Liferay MVC I recommend Spring MVC Portlet due to bigger community and documentation. Resources related to Spring development in Liferay couldn't be found at official Liferay documentation so it's better to Google for blog articles etc. I develop at Liferay 6.2, Spring, Spring Webflow, Spring MVC, Thymeleaf, Maven stack and I have few articles related to problems which I came across at my blog http://lukasgrygar.com
Office Network not allowed(Blocking) to create new liferay workspace Project
We are facing some issues while trying to create new workspace in Liferay, When we are in Office network it fails. It's not accepting to auto download eclipse liferay projects's plugins. These repository sites are giving errors on eclipse connection time out.
Note: when we are in Citrix VM or open networks it works perfectly. Browser able to reach, If you hit below mentioned URL in browser.. But Its failing to reach at Eclipse level. https://cdn.lfrs.sl/repository.liferay.com/nexus/content/groups/public/com/liferay/com.liferay.gradle.plugins.workspace/1.5.0/com.liferay.gradle.plugins.workspace-1.5.0.pom
Eclipse Version:Eclipse neon
Liferay Version:7.1

Integrating JBOSS and Eclipse

I have JBOSS server. I used to make web applications using just notepad++. I used to create the necessary folders like web-inf and files like web.xml. For larger projects doing all this and manually compiling has become cumbersome. I want to use eclipse for that. I saw this tutorial - http://www.eclipse.org/webtools/community/tutorials/BuildJ2EEWebApp/BuildJ2EEWebApp.html . But I don't understand how to make a server. I already have a server. What I want to do is write JSPs and Servlets in eclipse and the build should automatically be deployed in jboss server.
How to to this?
Install JBoss Tools
After that follow the instructions from here to get started and deploy apps to JBoss Server.
To automatically deploy apps after the build you could use a build tool such as ANT or Maven.
I wrote a tutorial for this some time ago: Setting up web development environments with Eclipse
It shows how to setup JBoss within Eclipse (in addition, it also shows how to setup Tomcat and Weblogic), and also shows how to build a simple sample Servlet to verify the proper installation.
If you already use JBoss on the server side, then have a look at the client side as well: http://www.jboss.org/developer
(I haven't tried it myself, but...)
Just open eclipse then go to:
"Help-> Check For Updates" It will check for eclipse updates and installs new availables.
Now "Help -> Eclipse Market Place" Search for "Jboss tools" from search result select one(as your eclipse version) and install it. It will add adapter for new jboss versions.
Now add new server from server view select Jboss version then next add your Home directory of jboss. Then finish.
Step 1 is optional but it sometime it helps.

Tutorial for creating own portlet in liferay with eclipse

I want to create My Own Portlet With the Eclipse JUNO for Liferay. I have googled a lot but that's provide me only for using with netbeans so can anyone guide me or give me link of the tutorial for the creating portlet from scratch in eclipse.
I have tried with the following
ADD-> new Liferay Projects
And then its not showing in a liferay the portlet which i have created
I have successfully installed liferay in my windows7 as well as i have also integrated ready made books portlet but just having while creating simple hello world portlet of my own
very before i have even follow this link http://www.youtube.com/watch?v=-EbyIbMWrCI
but its showing my portlet in update manager option in admin account as a status is "UNKNOWN"
For creating a portlet at Eclipse please have a look at Liferay development in Eclipse .
For getting ready portlet visible on Liferay you could find instructions for example on this: How to deploy portlets to Liferay?
Here is the installation guide and getting started tutorial.

How to redeploy the web app using the Eclipse IDE

Im new to Eclipse. I use Tomcat as my run time server, but every time I modified the jsp pages, Eclipse was still displaying the older one. Just wondering how to redeploy the application so the changes can be reflected.
Eclipse: Eclipse IDE for Java EE Developers 1.2.1.20090918-0703
Tomcat: Tomcat 6.0
Thanks
Doubleclick the server instance in question in the Servers view to open its configuration. Now, in the right top you should see a section called Publishing. Open it to verify and configure autopublishing settings.
Eclipse should do that automatically for you.
Otherwise, on the Servers view (Menu Window->Show View->Servers), you can right click on your Tomcat instance and hit "Publish" or "Restart"
Make sure you have the "JST Server Adapters" ("Web, XML and Java EE Development category") feature installed.
Eclipse's publishing functionality requries the project to be a "web project", and in some cases requires additional configurations.
Go to Windows > Preferences > Server > Runtime environments and add your tomcat
Either try using publishing, or (better I think) use the FileSync plugin. There you can tell which folders from your project should be copied (live) to what directory on your machine (the tomcat/webapps/yourapp). With a little more effort the filesync configuration can be made machine independent (only using one parameter as TOMCAT_ROOT), in case you want to check-in the project to a repository where others will use it.
Get the Tomcat plugin. It was nice because you can install Tomcat on your system and then associate your web app with that instance of Tomcat. The plugin will let you stop/start Tomcat and define a server such that when you do a build it knows how to deploy the changes. There may be some newer plugin but the Tomcat plugin worked for me and was fairly simple to install and use. Here is a page from IBM on using Eclipse and Tomcat. Inside that page it points you to the following: http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/

Eclipse Redeploy/Undeploy Web Project without Restarting the Server

In my eclipse web application I made a Web Project and a Library Project. The Web Project referenced the Library Project.
When I started the Server, every time I change a code in the Library Project and build it. The server wants to restart and it does not redeploy by the Web Project only. I do not want to restart the server because it takes a lot of time waiting the startup of the server.
Another is I am developing portlets using Liferay Portal and every time I change the Library Project, the auto-deploy of Liferay comes in but the Library Project Jar is locked and resulted to crash the portlet and did not deploy it until I restart the server.
Please Help!!!
In Java EE perspective find "Servers" tab at the bottom, delete your EAR out of there.
Try JavaRebel
If you install the nightly build of Liferay IDE (eclipse plugins for Liferay) it has support for delta-deployment where after the initial deployment (full deploy) it will only deploy the delta or just the individual files that you change as you save them (a single JSP or CSS file, etc).