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]

Reply via email to