3
votes

I am developing a Web GWT application, using Eclipse, Glassfish 4 for the local server part. I just started using Maven for the build.

My projects are structured like this:

* My core java classes (“ProjectCore”)
   Pom.xml => generates a JAR

* My custom java classes (“ProjectCustom”)
   Pom.xml => generates a JAR

* My web-app related java classes (“ProjectWeb”)
    Pom.xml => generates a JAR

* My WAR project (“WARproject”)
    Pom.xml => generates a WAR

* My EAR project (“EARproject”)
    Includes all of the above
    Pom.xml => generates an EAR

I managed to configure all the pom.xml files to generates all required JARs, WAR and EAR, and it successfully deploys to Glassfish (done by calling maven from command line)

However, in a development mode, where I frequently modify files & retest the app, the deployment takes too much time (1-2 minutes). Compiling and generating the JARs/WARs/EARs is still pretty fast but the actual undeployment + deployment on Glassfish takes more than 1 minute.

I am wondering how I can do hot deployment to GlassFish4 (also called ‘directory’ deployment), skipping all JAR/WAR archive generation, and only copying to GlassFish whatever files have been modified. I'd like the complete cycle "modify source file - deploy to Glassfish" to take a few seconds only...

I have been searching quite a lot but without success so far…

Could someone give me some directions to follow? - using "maven glassfish" plugin? - should I go for M2E-WTP plugin? - anyone using "manik-hot-deploy" Maven plugin?

Thanks in advance!

1

1 Answers

0
votes

Thanks for the feedback - I couldn't find the "maven glassfish plugin" from the Eclipse Marketplace. However : - I have installed M2E-WTP - Ensure that the "deploy on build" is checked (on my Glassfish server)

Everything works very well now. Whenever I make change, all code is compiled and automatically deployed within 1 or 2 seconds :-)

I think I was getting confused between the M2E-WTP (which does the work perfectly & seamlessly) and the "Maven build Run As" (this is what I was running and in my Pom.xml I was calling the maven-glassfish plugin to deploy to the server: very slow as it was doing a full undeploy & deploy).