Hey guys (sorry for the silence, got nailed with jury duty)
The asm-finder was sort of a temporary step. Ideally, we wouldn't
need our own version of the xbean-finder + asm and there'd be a shaded
version in xbean with the asm libraries repackaged to something like
org.apache.xbean.asm. We can then do a find/replace on
org.apache.openejb.asm -> org.apache.xbean.asm.
As far as any of the various deps modules being "gone". Any of them
are only one 'svn cp' command away. The downside to keeping them
around is that the maven shade plugin is more or less a hack.
It's complicated, but here it is:
There are two pom.xmls involved; the one that creates the shaded
module and the one that results from the shaded module. When the
"shading" is being done as part of the build the modules that depend
on the "shaded" module will get the first version of the pom.xml, i.e.
pre-shade, which contains all the dependencies we don't want and are
trying to "shade away" (i.e. get rid of). So we end up compiling and
testing with a classpath that is not the same classpath we ship with
which is risky; i.e. if we had a class that used org.objectweb.asm.Foo
it would still compile and run because the shaded module is still
pulling it in as maven is still using the pre-shaded pom for the
duration of the build. But... maven is smart enough to publish the
updated pom.xml, the post-shade version, where the shaded dependencies
are removed. So when it's not in the build you get the published
version which does not drag in the unwanted dependencies.
-David
On May 19, 2009, at 5:37 AM, Jean-Louis MONTEIRO wrote:
OK, thanks Jacek. It's much more clear for me.
OpenEJB is using "inlining" (org.apache.openejb.asm package).
asm-finder dependency has been built using a maven module (removed
since).
Fully agree with you: we have to restore this module in keep it in the
common OpenEJB module management process.
But something remains not clear (for us ;-)): why this module has been
removed since last release ?
May be David can give us a reason.
Jean-Louis
Jacek Laskowski wrote:
On Tue, May 19, 2009 at 10:29 AM, Jacek Laskowski
<[email protected]> wrote:
On Tue, May 19, 2009 at 9:36 AM, Jean-Louis MONTEIRO
<[email protected]> wrote:
My understanding is that if you go back to org.objectweb package
you
will
face hibernate issues because of ASM versions.
Is that true ?
Yes. That's the truth we have to struggle with. XBean comes with two
binary incompatible versions of asm - 2.2.3 (xbean-reflect) and 3.1
(xbean-finder). Hibernate relies on 1.5.3. When those come together
NCDFE surfaces. The only solution I can come up with is to shade
org.objectweb.asm package or replace it with another and use it -
that's how it works now in OpenEJB with asm-finder 3.1. The issue
I'm
facing at the moment is that I need to upgrade XBean to its latest
version ot fix the issue with @ApplicationException handling, but
asm-finder is not available in the repo (in its source form) so I
can't upgrade xbean in it. I need to resurrect it. That's why I
asked
what was the reason to whack it after it was published to the repos.
That's what I've not been able to explain so far.
Just to add to the above - Dave did "inlining" (package renaming),
but
there's another way to fix the issue with "shading". The difference
is
how much work and where one is willing to do. The former - inlining -
requires source code changes because org.objectweb.asm turns into
another package so you're forced to use the newly-created package
afterwards. It's that you copy classes into another package - the
classes are alike as far as their bytecode go minus package
declaration and imports. The former approach - shading - requires no
code changes but needs to create "a bundle" of necessary jar deps as
one big jar plus package change. Very useful.
For us, the best would be to repackage asm classes with inlining and
use the new packages in our code.
Jacek
--
Jacek Laskowski
Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
--
View this message in context:
http://www.nabble.com/asm-repackaging---asm-finder-%2B-our-asm-package-in-use-highly-needed-tp23575152p23615518.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.