buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ingo Schmidt" <antis...@der-ingo.de>
Subject Re: Re: Merging questions
Date Wed, 13 Feb 2008 09:36:05 GMT
Hi Victor!

> Ok, the problem here is you are referencing project("my_war-war").package(:war), You
actually need to add the
> "complete" package into your EAR,

Yes, I know. It just wasn't so nice and easy anymore as before. Well, the solution I have
now also works quite nicely, I don't end up with an extra package and I find it a bit more
readable, but thanks for suggestions, it helped in understanding what is going on.

> # If you are using current buildr HEAD # BUILDR-44 provides some syntactic sugar for
this (not in HEAD though).
> package(:ear).add :war => project('my_war-war').packages.find { |pkg| pkg.id =~ /complete/
}

That looks nice! I will check this out some point later in week.

> If  I understand correclty the  "Handling J2EE module dependencies" section
> you mention, It says Class-Path attributes are added to the manifest file of
> archived modules (read, each of your wars, ejbs, etc)

You are right. I got a bit confused because I have read so many documents and not all of them
are clear. And that section you mention, well, it would be nice if JRun actually DID it like
its doc states, but no, it does not. So the docs seem to suggest that it is J2EE 1.4 compliant,
but realitly looks like this (JRun4/Updater6):
Let's say my EAR looks like this:
EAR
  lib
    lib.jar
  WAR1
  WAR2
  EJB

Now I want to use lib.jar in my WARs and EJB. buildr now puts an entry into manifest.mf of
each module like so:
Class-Path: lib/lib.jar
And according to JRun docs and J2EE spec this seems to be right. But JRun4 reality is different.
There are 2 cases:

1. Modules are packed (*.war, *.jar)
    JRun4 extracts them to a temp folder and runs them from there. But it doesn't copy the
lib folder, so utility classes are not found.
2. Modules are expanded dirs
   JRun4 complains that it cannot find EAR/WAR1/lib/lib.jar, EAR/WAR2/lib/lib.jar, EAR/EJB/lib/lib.jar

If I change buildr to include a utility lib like so:
Class-Path: ../lib/lib.jar
everything works fine with JRun4.

So the only practical way to go with JRun4 is this:
- Modules have to be expanded dirs
- utility libs must be referenced relative to the MODULE and not EAR root

And there is yet another working way with JRun4:
Put Class-Path entry into EAR/META-INF/MANIFEST.MF like so:
Class-Path: lib/lib.jar
In that case you can even used archived modules. But I think we all agree that this is NOT
correct (Class-Path entry in EAR manifest.mf).

This situation had confused the hell out of me. But I think (or hope) that I am now on top
of it.

> Expanded packages are currently kind of experimental, see BUILDR-34.

I will also check this out some point later in week. As you saw above, I need this because
its the only decent way to create a working EAR for JRun4.

But I am already at a point, where buildr builds a rather large project very fine and fast.
It's looking good :)

Cheers, Ingo =;->

Mime
View raw message