There are different ways how to deploy Java EE application into an application server like Glassfish or JBoss. You can deploy your application using a command line tool or a web interface provided by your sever. Or you can use the autodeploy feature which means that you simply copy your application into a specific folder of your server (e.g. ../domains/mydomain/autodeploy/ for Glassfish)
The Eclipse IDE provides a plugin called “Web Tools Plattform” (WTP) which supports the hot deployment functionality for some application and web servers. But if you are using the Maven build tool the Ecipse WTP feature did not integrate smoothly with the maven project structure. So is most cases the hot deployment feature will get lost and the development and deployment will become time intensive and frustrating. This is the moment where manik-hot-deploy comes into play. manik-hot-deploy is an Eclipse plugin which supports hotdeployment functionality for your maven java enterprise project. It is easy to configure and speed-up the development of web and enterprise applications.
Autodeployment vs. Hotdeployment (Incremental Deployment)
Most application servers like GlassFish? or JBoss are supporting two different modes of automatic deployment. The autodeployment and the hotdeplyoment (also called incremental deployment).
Autodeployment means that you simply copy a web- (.war) or enterprise application (.ear) into a specific directory of our application server. For Glassfish this is the folder:
When you copy an application into that directory Glassfish will automatically detect the new artefact and starts a deployment process. If the application was already deployed before a redeployment will be started.
In different to autodeplyoment the hotdeplyoment (or incremental deployment) will not deploy the whole application but parts of your application which are updated or changed during development. This is a powerful feature which can save you a lot of time during development. Incremental deployment means, that in the moment when you are changing a web resource (like a .xhtml, .jsf or .css files) this change is immediately transferred into your deployed and running application. So there is no need to build and redeploy the application.
The Manik Hot Deploy Plugin for Eclipse
See how to install and use the Mani-Hot-Deploy Plugin for Eclipse to find an easy way to autodeploy your JEE projects form Eclipse into your application server.
4 Replies to “Maven Incremental hot deploy – a plugin for the Eclipse IDE”
Hello, I am planing to use this plugin since hot debugging using wtp and m2e is not working well for my application. First of all, thanks for creating this, great initiative and So useful. I would like to ask a couple of questions please: ..It’s been one year since last contribution, will it work for Wild Fly version 9 ?
Do you think l can use this plugin to make hot debugging for a jar Inside the libs folder in wild Fly ? ( the jar is created by one of the maven modules of my app, other modules create ear and wars accordingly but I Know already that this plugin handle those)
Thanks in advance
I think the plugin should work also with wildfly 9. I have not tested it yet but I don’t expect any changes there.
Concerning your question about jar files: please note that the plugin extracts an EAR or WAR file for WildFly during the auto-deploy phase. This is the recommended way to allow hot deployment of JSF/JSP fragments of a web module.
I don’t think that you can extract a jar file to use hot deploy of java classes. Normally you need to autodeploy your artefacts after a ‘maven install’ phase. This is what is meant with ‘autodeployment’
Thanks for your prompt response, got your point, and after setting up your plugin, I started the server in debug mode, it deployed the ear file properly, however, when I want to have the eclipse debugged stopped at a breakpoint it does not find the sources and the Edit Lookup Sources option does not show any of my maven projects to pick from, probably this question is out of this context but, maybe you have dealt with this issue as well.
Yes you need to edit the ‘lookup sources’ of the Eclipse debugger. The ‘Edit Lookup Sources’ shows normally a set of options where to lookup. Just use the option ‘project’ and add your project from the eclipse workspace.
But be careful – this option means that eclipse knows the structure of your project – in case of a maven project you need to configure your project first as a maven project – so eclipse will know where the sources are located. But you can also add simply the source folder manually from the filesystem. In a maven project the folder should be something like ‘..myproject/src/main/java/’