You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nicola Benaglia <ni...@tecno-progetti.eu> on 2008/05/03 18:21:27 UTC

create 2 jar from common packages

Hi,
I am moving my firsts step with Maven.
In my project I have the following Java code structure:

com.myproj.packageA
com.myproj.packageB
com.myproj.packageC
com.myproj.packageD

When I launch the package artifact (correct??) 2 jar should be created:

server.jar  (containing the compiled code from A,B,C)
client.jar (with A,B,D)

How can I do that? How can I manage common code packages?
Please be patient with my newbie trivial questions :)

Thank u in advance,
Nicola

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


Re: create 2 jar from common packages

Posted by Rainer Pruy <Ra...@Acrys.COM>.
Just to make explicit what Wayne said:

You might want to set up the following projects:

projectA:
containing all code for com.myproj.packageA

projectB:
containing all code for com.myproj.packageB

projectC:
containing all code for com.myproj.packageC

projectD:
containing all code for com.myproj.packageD


projectServer:
depending on projectA, projectB and projectC

projectClient:
depending on projectA, projectB and projectD

If you intend delivering a single jar for server and another one for client,
you might have a look at maven assembly plugin for use with the respective projects (projetServer, projectClent).

Rainer


Wayne Fay schrieb:
> Generally you would package A by itself, B by itself, C by itself with
> a dependency on A and B, and D by itself with a dependency on D.
> 
> Arguably you could package A and B together if they will always be
> used to together, producing a single AB artifact, and then depend on
> it in C and D.
> 
> Wayne
> 
> On Sat, May 3, 2008 at 11:21 AM, Nicola Benaglia
> <ni...@tecno-progetti.eu> wrote:
>> Hi,
>>  I am moving my firsts step with Maven.
>>  In my project I have the following Java code structure:
>>
>>  com.myproj.packageA
>>  com.myproj.packageB
>>  com.myproj.packageC
>>  com.myproj.packageD
>>
>>  When I launch the package artifact (correct??) 2 jar should be created:
>>
>>  server.jar  (containing the compiled code from A,B,C)
>>  client.jar (with A,B,D)
>>
>>  How can I do that? How can I manage common code packages?
>>  Please be patient with my newbie trivial questions :)
>>
>>  Thank u in advance,
>>  Nicola
>>
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>  For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

-- 
Rainer Pruy
Geschäftsführer

Acrys Consult GmbH & Co. KG
Untermainkai 29-30, D-60329 Frankfurt
Tel: +49-69-244506-0 - Fax: +49-69-244506-50
Web: http://www.acrys.com -  Email: office@acrys.com
Handelsregister: Frankfurt am Main, HRA 31151

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


Re: create 2 jar from common packages

Posted by Wayne Fay <wa...@gmail.com>.
Generally you would package A by itself, B by itself, C by itself with
a dependency on A and B, and D by itself with a dependency on D.

Arguably you could package A and B together if they will always be
used to together, producing a single AB artifact, and then depend on
it in C and D.

Wayne

On Sat, May 3, 2008 at 11:21 AM, Nicola Benaglia
<ni...@tecno-progetti.eu> wrote:
> Hi,
>  I am moving my firsts step with Maven.
>  In my project I have the following Java code structure:
>
>  com.myproj.packageA
>  com.myproj.packageB
>  com.myproj.packageC
>  com.myproj.packageD
>
>  When I launch the package artifact (correct??) 2 jar should be created:
>
>  server.jar  (containing the compiled code from A,B,C)
>  client.jar (with A,B,D)
>
>  How can I do that? How can I manage common code packages?
>  Please be patient with my newbie trivial questions :)
>
>  Thank u in advance,
>  Nicola
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>  For additional commands, e-mail: users-help@maven.apache.org
>
>

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