users@javaee-spec.java.net

[javaee-spec users] [jsr342-experts] Re: War vs EAR packaging

From: Adam Bien <abien_at_adam-bien.com>
Date: Wed, 29 Aug 2012 16:02:40 +0200

HI Antonio,

IMHO WARs are the new EARs. I use almost exclusively WARs in all my Java EE 6 projects.
EAR packaging is more flexible e.g. you can bundle a RAR with an EAR, what doesn't work with a WAR,

IMHO we should empower WAR to be as far as possible an EAR in Java EE 7. One lacking feature is a standard way to specify the context root...

adam
On 29.08.2012, at 14:36, Antonio Goncalves <antonio.goncalves_at_gmail.com> wrote:

> Hi all,
>
> Today I'm working on an existing Java EE 6 application running on JBoss 7.1. I was surprised to see an MDB packaged in a war file... and it's working ;o)
>
> It looks like JBoss has taken some liberty from the spec and allows MDBs (non web profile component) to be packaged in a war instead of an ear. But to be honest, I like it. So I'm wondering : when should I use an ear file ? The first answer would be "when I want to package several war together". As a developper why would I have other constraints ? Why couldn't I package an MDB in a war file ? And what about @Remote interfaces in a war file ? Why not ?
>
> Are there technical limitations/constraints that can't be solved (on the app server implementation side I mean) that would not allow to package any component in a war file ? The ear file would just stay to package war files (like a russian doll packaging mode).
>
> Any thoughts ?
> Antonio