Developing an eclipse plugin to deploy on my server - eclipse

How can we create an eclipse popmenu plugin (which is similar to Google App engine SDK). i.e. If I have created a project, when I clicked on the plugin menu, it should be able to deploy to my tomcat/webapps folder.

Why do you want to reinvent the wheel? The Eclipse Web Tools Platform already provides that functionality.
For deploying to a remote server you may choose the Export / Web / WAR file option from your projects context menu as shown below and export it directly to the remotly mounted tomcat/webapps folder as shown below.
If mounting the remote filesystem is not possible you will probably have to rely to ant or maven tasks to publish your war file.

Related

Teaching Eclipse To Deploy an Ant Generated WAR File With JBoss Tools

I've been asked to migrate an older Ant-based web application. I'm building and trying to deploy using Eclipse Luna with JBoss Tools 3.0.1.Final. JBoss instance is EAP 6.3.0 (AS 7.1).
The build tool, like I said, is Ant. And when I run ant package, a valid WAR file is created at /target/foo.war
For some reason I'm having a heck of a time trying to explain to Eclipse and JBoss server that the foo.war file is what I want to deploy.
To this end I've:
Right-clicked on the project root and opened the Properties dialog.
Declared custom Ant builder for the project by going to Builders and adding an Ant builder and disabling the default Java builder.
Now Project -> Clean removes the target/ folder; Project -> Build results in a /target/foo.war file.
So far so good. At this point, I think all I need to do is declare that foo.war file as the Web Deployment Assembly? If I go to Web Deployment Assembly and click Add, then add the target/foo.war file, it tries to add it as a project library (i.e. WEB-INF/lib/foo.war). So clearly that's wrong.
I've also gone to the Server view, and tried numerous settings in the Deployment tab. The closest I've come to what I'm looking for is the Default Settings, but I haven't had any luck there, either.
(When I start JBoss via the JBoss Tools in Eclipse, then pull up the management console on port 9990, I can upload and deploy the WAR that way with no issues.)
I'm sure there's something completely obvious I'm missing. Could anyone help an IntelliJ user out? I have seen https://stackoverflow.com/a/4261178/3223711, but it seems to be missing the "last mile" in that the problem is not generating the WAR but in getting JBoss to actually pick it up and use it.
Thanks!
Since you are not actually not configuring the project to be a war project by Eclipse knowledge you need to tell JBoss Tools that you wish to deploy the specific war file.
To do this right click on the target/foo.war and select 'Mark as Deployable' - this tell JBoss Tools this foo.war can be deployed meaning you can now drag it to a server or add it via Add/Remove on the server.

Integrate War-Plugin for m2eclipse into Eclipse Project

I set up a small web project with JSF and Maven. Now I want to deploy on a Tomcat server. Is there a possibility to automate that like a button in Eclipse that automatically deploys the project to Tomcat?
I read about a the Maven War Plugin but I couldn't find a tutorial how to integrate that into my process (eclipse/m2eclipse).
Can you link me to help or try to explain it. Thanks.
I set up a small web project with JSF and maven. Now I want to deploy on a Tomcat Server.
During development I recommend to use Eclipse Web Tools Platform (WTP). M2Eclipse provides support for it (assuming you have Maven Integration for WTP installed) and your project should be recognized as a Dynamic Web Project runnable on a Server.
So, declare Tomcat as a Server (show the Servers view and right-click in it to add a Server via New > Server). And deploy your project to it (right-click on your project then Run > Run on Server).
There are other options like using the Tomcat Maven Plugin or the generic Cargo Maven Plugin but I wouldn't use them for development and, since you are a Maven beginner, I don't recommend them at all. Use your IDE.
I read about a the Maven War Plugin but I couldn't find a tutorial how to integrate that into my process.
Actually, the Maven War Plugin is only responsible of the packaging of your webapp project (it is bound automatically on the package phase when using a <packaging>war<packaging> for your project). It isn't used for deployment. But as I said, use your IDE to deploy your application during development.
The war plugin is for generating war files, not for deploying them. What you are asking for may be provided by the Cargo Plugin. Another interesting candidate for you could be the jetty-maven-plugin.

How to deploy on JBoss exploded web application from Eclipse Galileo?

Is it possible to deploy on JBoss exploded web application(not archived war file) from Eclipse Galileo?
JBoss Tools supports exploded deployment with both "native" Web Tools(WTP) style projects (i.e. those projects created by the Dynamic Web Project based wizards) and via the generic Project Archives plugins.
If you already got a WTP style project then you simply just need to install jboss tools and create a server from the "JBoss Community" or "JBoss Enterprise Platform" category (The "JBoss" one is the WTP generic server which is very incomplete) and deploy your project to the server and it will by default be deployed exploded.
If you want to deploy in zipped form there is an option for this in the server editor (double click on the server in the server view and look in the deployment section)
We are using MyEclipse plugin for eclipse which has this specific capability, but it's a commercial plugin.
If you deploy your application only on JBoss, then you have the JBoss tools plugin for eclipse. According to their documentation they also support this mode and this plugin is free, but I have never tried it.
It has been a long time since I used it but, according to this post, it should be possible using JBoss Tools (previously known as JBoss IDE, before the merge with Exadel). Quoting the blog post:
One of my favorite feature in JBoss Tools is the "Project Archives" which provides automatic and incremental archiving of arbitrary directories into a zipped archive (jar,zip,war,etc) or into an exploded directory. Usable for any development that wants hot and/or exploded deployment.

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).