I've been using maven2 (and continuum) to build/deploy a j2ee project to
jboss for the last couple of weeks.

Heres what ive done (im not sure if its best practice, but it works):

I have a folder structure as follows 

toplevelmodule
        pom.xml
        /coremodule
                pom.xml
                /src etc..
        /ejbmodule
                pom.xml
                /src etc..
        /webmodule
                pom.xml
                /src etc..
        /earmodule
                pom.xml
                /src etc..

The top level pom defines all dependencies and is a
<packaging>pom</packaging> type pom. It lists all the submodules as
follows:

 <modules>
    <module>coremodule</module>
    <module>ejbmodule</module>
    <module>webmodule</module>
    <module>earmodule</module>
  </modules>
 
The submodules are respectively jar, jar, war and ear packaging types.

The build section of my ejb pom looks like this:

<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ejb-plugin</artifactId>
        <configuration>
           <generateClient>true</generateClient>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
                <archive>
                        <manifest>
                                <addClasspath>true</addClasspath>
                        </manifest>
                </archive>      
        </configuration>
        </plugin>
      </plugins>
</build>
        
My ear pom uses the jboss plugin in the build section

                <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jboss-maven-plugin</artifactId>
                <configuration>
                    <jbossHome>\jclickstart\jboss-3.2.7</jbossHome>
                </configuration>
            </plugin>   

To build I first navigate to my toplevelmodule directory and type 'mvn
clean install'
To deploy I cd into my earmodule dir and type 'mvn jboss:harddeploy'.

Hope this is useful.

Adam

-----Original Message-----
From: Wayne Fay [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 10, 2006 3:34 PM
To: Maven Users List
Subject: Re: Building J2EE project using Maven2


Personally I'm doing all the steps up to deploy with Maven, and then
actually deploying into oc4j using ant. I tried to use cargo briefly and
gave up since I had a working process in ant.

I'm not aware of any full examples. But look at the pom.xml files sent
by Marco in another thread titled "Additional file sincluded while
building an EAR" for some help -- he provided poms for all his jar, ejb,
web, and ear files. That will probably be a big help to you.

Wayne


On 10 Mar 2006 11:45:25 UT, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:
> Dear People,
>
> I am trying for three days to sort my problem, but i could not :(, 
> what i am trying to do is that to build my j2ee project (WAR, JAR and 
> EAR) and then deploy the ear into Jboss, i have done all that in ANT 
> but i could not do it in Mavevn 2, so there is any full example for 
> this please
>
> Regards,
>
> Adel
>
>
>
>
> Please consider AJ Business Solutions Ltd's disclaimer at the end of 
> this email before reading this message or opening any attachments.
>
>
>
>
>
>
>
>
>
>
> Adel Aneiba
> Software Development
> For and on Behalf of AJ Business Solutions Ltd.
> Tel : 0870 7518 900 Ext 42 // Fax : 0870 4 10 14 15
>
>
> This message is confidential and may be legally privileged. No 
> confidentiality or privilege is waived or lost by any mistransmission.

> If you are not the intended recipient please delete it and all copies 
> of it from your system, destroy any hard copies of it and notify the 
> sender immediately.
>
> You must not, directly or indirectly, use, disclose, distribute, 
> print, or copy any part of this message or any attachment if you are 
> not the intended recipient.
>
> We will not accept any liability for damage caused by computer viruses

> and it is your responsibility to scan attachments (if any).
>
> We may for the better performance of our business monitor incoming 
> e-mails sent through our e-mail system.
>
>

===========================================================================
The contents of this email are intended for the named addresses and may 
contain confidential and/or privileged material. If received in error, 
please contact UPCO head office on +44(0)113 201 0600 and then delete 
the entire mail from your system. Unauthorised review, distribution, 
disclosure or other use of information could constitute a breach of 
confidence. Your co-operation in this matter is greatly appreciated.

Every effort has been taken to ensure that this email and any 
attachments are virus-free. However, UPCO does not make any warranty 
to this effect, and is not liable for any damage done by an infected 
email message or attachment. UPCO recommends that all emails and 
attachments are checked before opening.

All views or opinions expressed in this electronic message and its 
attachements are those of the sender and do not necessarily reflect 
the views and opinions of The Ultimate People Company Ltd.
===========================================================================



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

Reply via email to