Hi,
I have two modules defined: my_ejb_client (jar) and my_ejb_implementation (ejb). Then
declare a dependency to the client module in the rich-client module and the ejb
implementation module. So the rich-client is totaly decoupled from the bean implementation.
That said. This is with EJB 3.0. If you use EJB < 3.0 and generate code with xdoclet this
setup probably won't work for you.
HTH
-Tim
[EMAIL PROTECTED] schrieb:
Hi,
I habe a problem with transitive dependencies when a project depends on a
ejb artifact (ejb-client). My system consists of a client application
(i.e. a rich client) which uses a ejb server application. The ejb server
application needs some other artifacts for the server side processing
(i.e. a DB access library). The client needs nothing else than the
client-jar of the ejb artifact. My project structure with some pom.xml
snippets looks as follows:
myclient
<artifactId>myclient</artifactId>
<dependencies>
<dependency>
<artifactId>myserver-ejb</artifactId>
<type>ejb-client</type>
</dependency>
</dependencies>
myserver
myserver-ear
<artifactId>pv-ear</artifactId>
<packaging>ear</packaging>
myserver-ejb
<artifactId>myserver-ejb</artifactId>
<packaging>ejb</packaging>
<dependencies>
<dependency>
<artifactId>my-db-lib</artifactId>
</dependency>
</dependencies>
It works almos fine. My problem is that the the client application
(myclient) does not only inherit the ejb-client-jar of the server project.
It inherits also the dependencies which are only used for server side
processing (my-db-lib). Is there a way to suppress this dependeny
inheritation (i.e. by setting a special scope on the my-db-lib
dependency)?
Setting the scope of the "my-db-lib" dependency to "provided" did not work
because the dependency was also excluded from the generated ear file.
The only way, i got it to work was by adding a exclusion to the client's
pom.xml:
<artifactId>myclient</artifactId>
<dependency>
<artifactId>myserver-ejb</artifactId>
<type>ejb-client</type>
<exclusions>
<exclusion>
<artifactId>my-db-lib</artifactId>
</exclusion>
</exclusions>
</dependency>
I don't like this solution because i have to change the client's pom every
time i add a internal library to the server project. Isn't there another
solution for controlling the exported dependencies of a ejb artifact?
Thanks for your help.
Regards, Matthias
--
Matthias Germann
DV Bern AG
mailto:[EMAIL PROTECTED]
http://www.dvbern.ch
Postadresse: Nussbaumstrasse 21, Postfach 106, 3000 Bern 22
Direktwahl: +41 31 378 24 60
Telefonzentrale: +41 31 378 24 24, Telefax: +41 31 378 24 74
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]