First of all, i want to wish you all a Happy new year and thanks for every
reply!!
Well, i gone after Better Builds with Maven and that helped-me to find
myself how could i do this with Maven kind of deployment with Maven but,
sadly, i'm still facing some issues.
I've split my project into 3 modules and packaged the "root-project" as a
POM which is inherited by every sub module in this project.
So, my directory structure is something like that:
project
|
web ( created with maven archetype webapp )
| pom.xml
ejb ( created as an ordinary maven archetype project)
| pom.xml
ear ( empty except by the pom.xml)
| pom.xml
|pom.xml
But when i go for /project/mvn package, the ear seems to include only a
"previous installed" version of my web/target/project.war which must be
installed previously at my local repo by project/web/mvn install.
There is a way i can do this whole process by a project/mvn deploy command,
or something as simple as that?
Sorry about taking so long for replying but i went away for some days and
about the length of this email.
Thanks about every reply!
Best Regards,
Vitor Pellegrino
-----------------
there goes project/pom.xml
<project>
....
<modules>
<module>ear</module>
<module>ejb</module>
</modules>
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.0.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitemesh-plugin</artifactId>
<version>2.0.2-SNAPSHOT</version>
</dependency>
</dependencies>
....
</project>
project/ejb/pom.xml
<?xml version="1.0"?>
<project>
<parent>
<artifactId>project</artifactId>
<groupId>com.project</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ejb</artifactId>
<name>ejb</name>
...
<dependencies>
...
</dependencies>
</project>
project/web/pom.xml
<project>
....
<artifactId>web</artifactId>
<packaging>war</packaging>
<name>webapp</name>
<dependencies>
<dependency>
<groupId>com.project</groupId>
<artifactId>ejb</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>jboss</groupId>
<artifactId>jboss-ejb3x</artifactId>
</exclusion>
</exclusions>
</dependency>
...
</dependencies>
...
</project>
project/ear/pom.xml
<project>
....
<artifactId>ear</artifactId>
<packaging>ear</packaging>
<name>ear</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<modules>
<ejbModule>
<groupId>com.project</groupId>
<artifactId>ejb</artifactId>
<bundleFileName>
ejb-1.0-SNAPSHOT.ejb3
</bundleFileName>
</ejbModule>
<webModule>
<groupId>com.project</groupId>
<artifactId>web</artifactId>
<contextRoot>/project</contextRoot>
</webModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.project</groupId>
<artifactId>ejb</artifactId>
<version>1.0-SNAPSHOT</version>
<type>ejb</type>
<exclusions>
<exclusion>
<groupId>jboss</groupId>
<artifactId>jboss-ejb3x</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.project</groupId>
<artifactId>web</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>
</project>
On 12/28/06, Alexander Sack <[EMAIL PROTECTED]> wrote:
I'm not following. It IS a JAR and there is nothing special about it
other
than the annotations which is only relevant at deployment time to the
container.
One of the major design goals of EJB3 is to have less overhead with
respect
to the number of deployment artifacts and to be more POJO centric. The
current Maven EJB plugin as I understand it is written to alleviate the
complexities of the side artifacts one would normally have to create when
creating older version EJB based applications. There is a usage mismatch
(I
could be wrong) between the current Maven EJB plugin and EJB3 deployments
(or at least JBoss EJB3 deployments, I won't speak for other containers).
Finally, JBoss specifically treats EJB3 based applications as simple JARs
(you can deploy EJB3's in JAR format without including them in an EAR and
the Eclipse based EJB3 plugin is last I checked simple classpath
containers
pointing to the appropriate EJB3 JBoss libraries to link against).
As for including them in an EAR, yes they are just listed as a dependency
and javaModule.
-aps
On 12/28/06, Stephane Nicoll <[EMAIL PROTECTED]> wrote:
>
> On 12/28/06, Alexander Sack <[EMAIL PROTECTED]> wrote:
> > I'm not sure why you are using the EJB plugin since EJB3 and JBoss are
> just
> > JARs. We use EJB3 and JBoss exclusively and I prefer the JAR plugin.
>
> If your EJB3 project is built with the 'jar' packaging, it is handled
> as a library by the EAR plugin (namely). The concept of artifact's
> type is important so what you're doing sounds more like a hack.
>
> What do you do when you generate an EAR with your EJB archives
> declared with a 'jar' type.
>
> Regards,
> Stéphane
> >
> > -aps
> >
> > On 12/27/06, Stephane Nicoll <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi,
> > >
> > > On 12/26/06, Vitor Pellegrino <[EMAIL PROTECTED]> wrote:
> > > > Hello,
> > > >
> > > >
> > > > 1 - How can i deploy my project using maven to my Jboss AS
instance?
> > >
> > > Have a look to cargo.
> > >
> > >
> > > > When i try to do a "mvn ejb:ejb" it is lacking for a
ejb-jar.xmlfile
> > > and at
> > > > the plugin's usage page it's says that it's not mandatory anymore.
> > >
> > > Set the packaging of your project to EJB. Regarding the fact that
> > > ejb-jar is not mandatory, I think it's not released yet so you'll
have
> > > to take the snapshot (the doc is the doc of the dev version).
> > >
> > > > It seems i am losing some point because i don't know where else
more
> > > should
> > > > i look for these answers.
> > >
> > > Take an hour and check "Better builds with Maven" book, it will help
> > > jumping on board
> > >
> > > Let us know how you go.
> > >
> > > Cheers,
> > > Stéphane
> > >
> > >
> > > >
> > > > Thanks for any help!
> > > >
> > > > PS: Sorry about my english, it's not my first tongue. I hope i
could
> > > made
> > > > myself understood.
> > > >
> > > > --
> > > > Vitor Pellegrino
> > > >
> > > >
> > >
> > >
---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > "What lies behind us and what lies in front of us is of little concern
> to
> > what lies within us." -Ralph Waldo Emerson
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
"What lies behind us and what lies in front of us is of little concern to
what lies within us." -Ralph Waldo Emerson
--
Vitor Pellegrino