Search code examples
javadeploymentxhtmlearhotswap

Java, Deployment strategies for ear files


Build man. -> maven

ide -> idea

app server -> weblogic 12.1.2

My project consists of an ear file that has two war files (residing under lib, not exploded) and several jar files.

I deploy the ear file, and when I make a change in any java file, hot swap works fine ( any regular change ) . However when I make a change in any xhtml ( mostly consisting jsf ), in order to see these changes I have to take another build & deploy.

I'm in need of any strategy that I can follow in development phase. All comments are welcome.


Solution

  • The following steps were very helpful for me :

    • Making sure the final build consists of an exploded version. This can be accomplished very easy using make for build management ( comes default on idea ) or if one wants to stick to maven for build management a plugin is needed to create an exploded final product such as : http://maven.apache.org/plugins/maven-war-plugin/exploded-mojo.html

    • The commonly edited resource files or views ( xhtml in my case ) to be marked as source files. This can be accomplished by "Mark directory as " option which enables for a hot swap everytime the project is updated for the files residing in the directory that is marked as a source root.

    However I must admit, these were not even nearly enough for me. I still needed to redeploy everytime I change the signature of a class which was very frequently the case, and was highly a waste of time.

    In order to tackle with the remaining class reloading pain, me and my team to use JRebel, which I'm currently very satisfied with. Keeping in mind that this product is relatively expensive, I also heard of open source class reloader alternatives, but frankly haven't given them a go yet :