javadeploymentejb-3.0jboss-eap-4.3.x

How to Deploy Simple Java Projects into EAR?


I am using MyEclipse and I use an Enterprise Application Project (EAP) that automattically deploys my Web and EJB Projects.

These projects use some other projects that are just POJOs, "simple" java projects. Like a library kind of thing.

The problem is that when I change something in on of the "simple" java projects I have to redeploy my entire EAP in my JBoss in order to see the changes.

What I want is a way to automatically deploy those projects (POJOs) in the EAP, so hot code replacement works with those too.

Any ideas?


Solution

  • With JBoss, you can just drop your JARs in the server/default/deploy directory - this was at least true with older versions - thanks to JBoss special classloader (hate it or love it).

    With WebLogic, you could use "Shared Libraries".

    In both cases, the mentioned features are proprietary, i.e. non standard and using them will make your application not portable.


    Sorry, I meant automatically. Like this: 1) Running server 2) Modify something on the Java Project (library) 3) Oh-oh, i have to manually redeploy the library (make a jar, copy, and restart server). I want it to make changes automatically, like a hot deploy kind of thing.

    Ahhhh, ok, got it now. In that case, "Exploded Archive Deployment" is the way to go and is supported by MyEclipse (and JBoss). Quoting 7.1 J2EE Project Deployment Modes:

    MyEclipse can deploy Web, EJB, and Enterprise Application projects to any MyEclipse enabled application server. Two deployment packaging modes are supported by MyEclipse: exploded archive deployment and packaged archive deployment.

    • Exploded Archive Deployment - This is a development-centric but non-standard J2EE application packaging and deployment model. Similar to packaged deployment, an application's deployable resources are organized to conform to a J2EE standard directory/file structure. But, rather than create and deploy a single archived file, the entire application resource structure - directories and files - is copied by the application server connector to the server's special deployment location for exploded archives. The MyEclipse Deployment Service, using "Sync-on-Demand" technology, will keep all MyEclipse project deployments synchronized with all source changes in their corresponding MyEclipse project. Note: exploded deployment is not supported by the J2EE standard and is not supported by all application servers.