tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Davidson" <stephen.david...@etcc.com>
Subject RE: different versions of jars within EAR/WAR/EJB module
Date Sun, 21 Feb 2010 17:36:54 GMT
Hi Karsten.

I had this problem as well, especially my project uses multiple wars.  I
researched "skinny wars", and found a solution.  In a nutshell, you have
jars & wars declare all shared dependencies (such as commons-logging, or
whatever third-party library has this as its dependency) with scope
"provided".  You can do this by default be declaring your shared
dependencies at the parent pom level.
Then, in the EAR's pom, I redeclared the dependency, without the
"provided" scope.  The only annoying thing was when I had to
automatically provide some jars on a EAR wide level.  I had to add the
following section;
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<!-- configuring the ear plugin -->
<configuration>
<!-- (one for each jar to had to have its classes automatically
available, dependency MUST be explicitly declared in the pom's
dependency section) -->
  <jarModule>
    <groupId>groupId</groupId>
    <artifactId>shared</artifactId>
    <bundleDir>lib</bundleDir>
  </jarModule>
</configuration>
<plugin>

Regards,
Steve

-----Original Message-----
From: Karsten Ohme [mailto:koh@mms-dresden.de] 
Sent: Sunday, February 21, 2010 11:16 AM
To: users@openejb.apache.org
Subject: different versions of jars within EAR/WAR/EJB module

Hi,

I have the following problem:

I'm using different utility libraries which are using also different 
versions of e.g. Apache-commons libraries. Now some libraries are used
in different versions. So, I have possibly some default library versions
in the application server and some library versions in my ear and the
ear can also include different library versions.
Which library wins? Until now somehow this always worked, but now I had
the problem with different versions. I received strange exceptions while
using different versions together.

How can this problem be solved? Do I have to exclude in my Maven
configuration all duplicates manually?

Regards,
Karsten

-- 
Karsten Ohme
T-Systems Multimedia Solutions GmbH
Portal Technologies, Applications & Appliances
Hausanschrift: Riesaer Strasse 5, 01129 Dresden
Postanschrift: Postfach 10 02 24, 01072 Dresden
Telefon: +49 351 28 20 - 2123
Fax: +49 171 351 28 20 - 5116
E-Mail: karsten.ohme@t-systems.com 


Mime
View raw message