Tim thanks for your message.  You have brought up a
very good point, in that the WAR and EJB pieces of my
application do essentially go together, so there's no
real need to build a WAR and EJB JAR to include in an
EAR when I can just create the EAR instead.  If this
is the case then I need to figure out the correct
layout for my development directories which Maven will
expect to find when I run maven ear.

1. Where do the JSP pages & image directories go ?  Do
these go in src/webapp, or is this only relevant for
maven war ?  What about the WEB-INF with the web.xml
etc. ?

2. Where do I put the ejb-jar.xml and jboss.xml ? 
Should I perhaps keep all of the JBoss related config
files such as jboss.xml and jboss-web.xml someplace
else and separate from the base application, in order
to make the code more generic ?  How would one go
about isolating just the JBoss elements into their own
areas, but then including these when building an EAR ?

3. I have some JMX MBean classes that need to be
deployed in a separate SAR file (in order to be run as
JBoss services), but which the classes of my
application access indirectly.  Is there a special
directory layout for these classes and their
associated META-INF/jboss-service.xml ?  Also these
MBean classes use a few classes found in the core of
the application (some custom Exception and JavaBean
classes) - how is this handled ?  Should this be a
separate project from the main application ?

4. Do I need to create an application.xml for the EAR
?  how to begin ?  It seems that since I have no web
or ejb modules then I don't need to specify anything
in the application.xml.


Thanks in advance for any help.


--James



--- Tim Stephenson <[EMAIL PROTECTED]> wrote:

> James, 
> 
> Are the three directory structures you describe
> different projects
> (each with own project.xml) or do they overlap? If
> they overlap this
> is the first thing to change. I can't find the
> reference on the FAQ or
> elsewhere in the web site, but I am pretty sure
> maven strongly advises
> against creating several artifacts (jar, war etc.)
> from a single
> project, which I think makes perfect sense but it
> can be a hurdle to
> understanding maven for some people I have had
> conversations with.
> 
> Assuming that they are different projects, you
> should be able to build
> the EJB and the WAR files already? In the respective
> project dir you
> should run 'ejb:install' and 'war:install'. This
> will build the EJB
> and WAR files and place them into your local
> repository. For more
> help, check the EJB and WAR plugin reference pages
> at:
> 
>   http://maven.apache.org/reference/plugins/ejb/ and
> 
>   http://maven.apache.org/reference/plugins/war/
> 
> Then in the EAR project's project.xml you need to
> specify these
> dependencies for the EJB and WAR projects with some
> special properties
> to say they should be bundled in the EAR file. It
> will look something
> like this:
> 
>               <dependency>
>                       <groupId>MyProj</groupId>
>                       <artifactId>MyProj-ejb</artifactId>
>                       <version>1.0</version>
>                       <type>ejb</type>
>                       <properties>
>                               <ear.bundle>true</ear.bundle>
>                       </properties>
>               </dependency>
>               <dependency>
>                       <groupId>MyProj</groupId>
>                       <artifactId>MyProj-web</artifactId>
>                       <version>1.0</version>
>                       <type>war</type>
>                       <properties>
>                       
>
<ear.appxml.war.context-root>/MyWeb</ear.appxml.war.context-root>
> 
>                               <ear.bundle>true</ear.bundle>
>                       </properties>
>               </dependency>
> 
> Finally run the goal 'ear' (or 'ear:install') to
> create the EAR file.
> More help on the EAR plugin is available at:
> 
>     http://maven.apache.org/reference/plugins/ear/
> 
> Hope this helps, 
> Tim 
> 
> On Mon, 14 Feb 2005 15:49:35 -0800 (PST), James
> Adams
> <[EMAIL PROTECTED]> wrote:
> > I want to build an EAR file which contains a WAR
> and
> > EJB JAR.  Currently I am able to have all of my
> class
> > files put into a single JAR, whether I do "maven
> ejb"
> > or "maven war", but really what I want is a goal
> which
> > will
> > 
> > 1.  Create the WAR with all JSPs and Servlet
> classes.
> > 
> > My project's directory layout as far as web
> components
> > goes looks like this:
> > 
> > myproject
> >  +-- src
> >        +-- java
> >              +-- all needed packages including
> > servlets
> >        +-- webapp
> >              +-- WEB-INF
> >                    +-- web.xml
> >                    +-- jboss-web.xml
> >              +-- all JSP and HTML files, img
> > directories, etc.
> > 
> > 2.  Create the EJB JAR with all EJB and dependency
> > classes
> > 
> > My project's directory layout as far as EJB
> components
> > goes looks like this:
> > 
> > myproject
> >  +-- src
> >        +-- java
> >              +-- all needed packages including
> ejbs
> >        +-- ejb
> >              +-- META-INF
> >                    +-- jboss.xml
> >                    +-- ejb-jar.xml
> > 
> > 3.  Create an EAR file which includes both the WAR
> and
> > EJB JAR created above
> > 
> > My project's directory layout as far as EAR
> components
> > goes looks like this:
> > 
> > myproject
> >  +-- src
> >        +-- application
> >              +-- META-INF
> >                    +-- application.xml
> > 
> > In the end I want the EAR to contain the EJB JAR
> and
> > WAR files, with an application.xml specifying the
> > modules.  Is this possible ?  Are the directory
> > layouts above what I need for this sort of Maven
> goal
> > ?  Since the Servlet and EJB classes are both
> under
> > the src/java directories how will I tell Maven
> which
> > classes need to go in the WAR file and which ones
> go
> > in the EJB JAR ?
> > 
> > Any suggestions greatly appreciated !
> > 
> > --James
> > 
> > __________________________________
> > Do you Yahoo!?
> > The all-new My Yahoo! - What will yours do?
> > http://my.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to