Here's the basic gist of what I'm after:

Since our EJBs are course-grained, we pass and return value objects in our
signature methods... for example, let's take an EJB and call it
"ObjectLookup", which has the following method:

public Thingy getThingy(ThingyIdentifier id);

Now, of course, I would need the jar that defines a "Thingy" (let's call it
"thingy.jar") as a dependency when I compile these interfaces, so I add it
as a dependency with "compile" scope and it compiles just fine.

Now is where it gets interesting though...

As I understand it, EJBs are supposed to be stand-alone components, so
wherever the ObjectLookup EJB jar gets deployed to, it has to have a
"thingy.jar" INSIDE the ObjectLookup EJB jar (as well as a corresponding
Manifest.mf classpath entry inside the ObjectLookup EJB jar) so that the
container fully understands the EJB component (otherwise the ejb-compile
fails).

So... I guess I'd be interested in hearing your thoughts as to what the best
way of accomplishing this is.  The assembly task sounds like the best
option... how would I implement this using that task?  What hook would I
need to use to modify/manually include the Manifest.mf?

P.S. - On a side note, I've found Maven to be a phenomenally powerful
product that WILL have an immediate impact on the quality of software from
our community.  Many kudos on all your hard work!


-----Original Message-----
From: Brett Porter [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 22, 2005 8:37 AM
To: Maven Users List
Subject: Re: M2 - Dependent Jars for EJB

> I tried your example... here's my pom.xml entry:

This generates an -client.jar alongside the main EJB (but a bug in
alpha-2 caused it not to work).

But it appears you want something else...

> Of course, nothing different happens when I generate the jar, so I'm
> guessing that this functionality isn't implemented yet.  I'm not entirely
> sure this will suit my needs anyway... our team uses course-grained EJBs
and
> I need the server-side EJB jar to include some libraries in it (and add
the
> necessary "Classpath" entries in the Manifest.mf).

I haven't heard of it being used this way before - are you sure you do
not want to use the EAR plugin to bundle the ejb's together?

> This completely baffles me that no one has had a need to include a jar
> inside of a jar.  I know of the "uberjar" in Maven 1.0, but that's not
> really what I need either (don't need the bootstrap-code/runnable-jar
> features).  The best technique I've come up with is to painstakingly use
the
> required jars as <resources> in the pom.xml... which is an embarrassing
hack
> to which I'm trying to find a better technique.

You can actually use the assembly plugin to do this now (though no
classpath line). It is uncommon for people to do this as class-path
generally doesn't work with jars in a jar. IT can also repack several
JARs into one.

If you let us know which of these options suit best, I can point you
in the direction of how to implement it.

Cheers,
Brett

---------------------------------------------------------------------
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