You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Boyle, PJ" <PJ...@agriculture.gov.ie> on 2007/12/19 16:55:53 UTC

How to either merge a jar with one of its dependencies OR reference a jar assembled with dependency

Hi,

I am trying to build a set of projects that ultimately produces a
library that will be distributed
to other applications. The library consists of the web application
filter which needs to invoke
some EJBs running in another process. At the moment I have structured my
maven projects so I have
three projects:

a server project - this contains the server implementation of the EJB, I
have a sub-project here
for generating the .ear and one for generating the .jar. I have also
enabled generation of the client
.jar that my EJB client will use:

<generateClient>true</generateClient>

This works fine and my server-ejb and client-ejb components are created
nicely.

Next I want to be able to invoke that server-ejb from a library
component that will be distributed
as a .jar. So I have declared a dependency in this library project on
the ejb-client:

<dependency>
  <groupId>${groupId}</groupId>
  <artifactId>serverside-ejb</artifactId>
  <version>1.0.00-SNAPSHOT</version>
  <type>ejb-client</type>
</dependency>

No problems so far - however now is the piece that I am getting caught
out on. I want to be able to
distribute only a single .jar from this project to the other
applications using this library. So I want
to create a .jar which contains the classes from the ejb-client, along
with my other code for the library
information.

So I created a custom assembly that would perform this activity - that
works fine, so now I have created
and deployed a .jar to the repository called
library-jar-1.0.00-SNAPSHOT-jar-with-dependencies.jar. Probably
not a great solution but works ok.

However - now I cannot see a clean way to reference this artefact from
my client applications so I am stuck!

Here is a little diagram of the current project layout:

authentication-server-project
-- authentication-ejb 

authentication-library-project
-- authentication-library

authentication-library-consumer-project
-- consumer-webapp

I have a feeling the best way to tackle this would be to build the
output from the library project so that it
does contain the ejb-client dependency but without using an assembly so
that it gets deployed to the repository
the way I want it.

Thanks in advance for any help,

Pj.


****************************************************************************   
***************  Department of Agriculture, Fisheries and Food ******************

The information contained in this email and in any attachments is 
confidential and is designated solely for the attention and use of 
the intended recipient(s). This information may be subject to legal 
and professional privilege.  If you are not an intended recipient of
this email, you must not use, disclose, copy, distribute or retain 
this message or any part of it. If you have received this email in 
error, please notify the sender immediately and delete all copies
of this email from your computer system(s).
****************************************************************************   


****************************************************************************   
****************  An Roinn Talmhaíochta, Iascaigh agus Bia  *******************

Tá an t-eolais san ríomhphost seo, agus in aon ceangláin leis, 
faoi phribhléid agus faoi rún agus le h-aghaigh an seolaí amháin.
D’fhéadfadh ábhar an seoladh seo bheith faoi phribhléid 
profisiúnta nó dlíthiúil. Mura tusa an seolaí a bhí beartaithe 
leis an ríomhphost seo a fháil, tá cosc air, nó aon chuid de, 
a úsáid, a chóipeál, nó a scaoileadh.  Má tháinig sé chugat de 
bharr dearmad, téigh i dteagmháil leis an seoltóir agus scrios an 
t-ábhar ó do ríomhaire le do thoil.     
****************************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org