You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ma...@dvbern.ch on 2006/05/24 11:45:28 UTC
ejb-client and transitive dependencies
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:matthias.germann@dvbern.ch
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
Re: ejb-client and transitive dependencies
Posted by Tim Kettler <ti...@udo.edu>.
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
Matthias.Germann@dvbern.ch 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:matthias.germann@dvbern.ch
> 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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: ejb-client and transitive dependencies
Posted by ryuko <ry...@googlemail.com>.
Hi,
I'm having the same issue with unwanted dependencies. Has there been a
solution to this problem?
The setup i have is:
Project A (EAR) -> Project B (Ejb with generateClient)
Now i have Project C which need only Project Bs' ejb-client.jar excpect i
get all of Project Bs' dependencies.
Thanks.
--
View this message in context: http://www.nabble.com/ejb-client-and-transitive-dependencies-tp4538361s177p16306219.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org