quality@glassfish.java.net

Re: EJB development with Maven, making it easier and more fool proof.

From: Wouter van Reeven <wouter_at_van.reeven.nl>
Date: Tue, 16 Mar 2010 09:25:20 +0100

Hi Richard,

On Tue, Mar 16, 2010 at 10:13:56AM +0200, Richard Kolb wrote:
> If you do this same thing in a Maven WAR, the lib is bundled in WAR file
>
> you can try it out.
> 1) on the command line build your EJB with a mvn package. Note the file size
> 2) Change the packaging to 'war' in the pom.xml
> 3) create a web.xml in /src/main/webapp/WEB-INF
> e.g.
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app version="2.5"
> xmlns="http://java.sun.com/xml/ns/javaee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://
> java.sun.com/xml/ns/javaee/web-app_2_5.xsd" >
> </web-app>
>
> 4) do a 'mvn clean package'
> 5) Note the file size of the WAR (log4j is included)
>
> Obviously the WAR packaging has a 'WEB-INF/lib/' where all the JAR's can be
> dumped and Maven takes advantage of this.
>
> I don't think EJB packaging has such a facility. (Not 100% sure of this)

I agree. For more info on the maven-ejb-plugin, see

http://maven.apache.org/plugins/maven-ejb-plugin/index.html


Thanks, Wouter

-- 
Oh the sisters of mercy, they are not departed or gone.
They were waiting for me when I thought that I just can't go on.
And they brought me their comfort and later they brought me this song.
Oh I hope you run into them, you who've been travelling so long.
[Leonard Cohen - The Sisters Of Mercy]
Skype: wvreeven
Facebook: wvreeven
Twitter: wvreeven