You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Yves Dessertine <yv...@gmail.com> on 2009/01/26 14:13:45 UTC

Sharing (big) parts of source across projects

Hi.

I have an (Ant) project which generates a JAR, plus a WAR for
webservices, to port to maven. I have a question about the best
practises:

1) I created a subproject for the webservices, ok like this?

2) The Webservices uses lots of source from my main project what's the
best approach ? Déclare two source path (ws + parent) ? Make the WS
subproject depend on the parent project ?

Thanks,

Yves Dessertine

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


Re: Sharing (big) parts of source across projects

Posted by Yves Dessertine <yv...@gmail.com>.
Well, this code is an enterprise project, which is quite complicated.
the "common" are the bare minimum classes for the web services to
work. The "heavy" is the programm which is deployed as part of a
proprietary framework. Thanks for the answer, it's the solution we've
adopted!




2009/1/26 Kent Närling <ke...@seamless.se>:
> What is the reason for the "heavy" part for the "full featured"? More
> functionality? it has an UI?
>
> It seems you probably might to create something like:
> - myproject
>    - myproject-common (jar)
>    - myproject-heavy (jar)
>    - myproject-webservices (war)
>
>
> 2009/1/26 Yves Dessertine <yv...@gmail.com>
>
>> 2009/1/26 Geoffrey Wiseman <ge...@gmail.com>:
>> > The WAR is your web services?  What do you use the JAR for?
>> > Based on the limited understanding I have of your project, I'd say that
>> > basically, you want:
>> >
>> > myproject (pom project, no real implementation other than the two
>> modules)
>> > -  "myproject-jar" -- whatever this project is for; common? library?
>> domain?
>> >  JAR packaging.
>> > -  "myproject-web-services" -- depends on myproject-jar as a JAR, WAR
>> > packaging.
>>
>> Thank you Geoffrey for your answer. Yes, that's what I want. It now
>> compiles, thank you. The WAR contains the web services, and the JAR is
>> a common lib, that we need to distribute.
>>
>> But, a new problem now pops up : can we build two versions of the JAR
>> ? One light version to use with the Web services, and another, heavy
>> version to distribute and full-featured ? While it works as it's now,
>> the JAR included in the war, is much more heavy than before (where an
>> Ant task picked up a few files to generate the "lightweight" jar). The
>> few files are shared across the "lightweight" and the "heavy" jar...
>> What to do now ? Put them in a seperate sub project ?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
> --
> Kent Närling
>
> System Architect
> SEAMLESS
> Dalagatan 100, 8 tr, 113 43 Stockholm, Sweden
> Phone: +46 8 5648 7800, fax: +46 8 5648 7823
> Mobile: +46 70 836 9925
> Mail: kent.narling@seamless.se
> www.seamless.se
>

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


Re: Sharing (big) parts of source across projects

Posted by Kent Närling <ke...@seamless.se>.
What is the reason for the "heavy" part for the "full featured"? More
functionality? it has an UI?

It seems you probably might to create something like:
- myproject
    - myproject-common (jar)
    - myproject-heavy (jar)
    - myproject-webservices (war)


2009/1/26 Yves Dessertine <yv...@gmail.com>

> 2009/1/26 Geoffrey Wiseman <ge...@gmail.com>:
> > The WAR is your web services?  What do you use the JAR for?
> > Based on the limited understanding I have of your project, I'd say that
> > basically, you want:
> >
> > myproject (pom project, no real implementation other than the two
> modules)
> > -  "myproject-jar" -- whatever this project is for; common? library?
> domain?
> >  JAR packaging.
> > -  "myproject-web-services" -- depends on myproject-jar as a JAR, WAR
> > packaging.
>
> Thank you Geoffrey for your answer. Yes, that's what I want. It now
> compiles, thank you. The WAR contains the web services, and the JAR is
> a common lib, that we need to distribute.
>
> But, a new problem now pops up : can we build two versions of the JAR
> ? One light version to use with the Web services, and another, heavy
> version to distribute and full-featured ? While it works as it's now,
> the JAR included in the war, is much more heavy than before (where an
> Ant task picked up a few files to generate the "lightweight" jar). The
> few files are shared across the "lightweight" and the "heavy" jar...
> What to do now ? Put them in a seperate sub project ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Kent Närling

System Architect
SEAMLESS
Dalagatan 100, 8 tr, 113 43 Stockholm, Sweden
Phone: +46 8 5648 7800, fax: +46 8 5648 7823
Mobile: +46 70 836 9925
Mail: kent.narling@seamless.se
www.seamless.se

Re: Sharing (big) parts of source across projects

Posted by Yves Dessertine <yv...@gmail.com>.
2009/1/26 Geoffrey Wiseman <ge...@gmail.com>:
> The WAR is your web services?  What do you use the JAR for?
> Based on the limited understanding I have of your project, I'd say that
> basically, you want:
>
> myproject (pom project, no real implementation other than the two modules)
> -  "myproject-jar" -- whatever this project is for; common? library? domain?
>  JAR packaging.
> -  "myproject-web-services" -- depends on myproject-jar as a JAR, WAR
> packaging.

Thank you Geoffrey for your answer. Yes, that's what I want. It now
compiles, thank you. The WAR contains the web services, and the JAR is
a common lib, that we need to distribute.

But, a new problem now pops up : can we build two versions of the JAR
? One light version to use with the Web services, and another, heavy
version to distribute and full-featured ? While it works as it's now,
the JAR included in the war, is much more heavy than before (where an
Ant task picked up a few files to generate the "lightweight" jar). The
few files are shared across the "lightweight" and the "heavy" jar...
What to do now ? Put them in a seperate sub project ?

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


Re: Sharing (big) parts of source across projects

Posted by Geoffrey Wiseman <ge...@gmail.com>.
On Mon, Jan 26, 2009 at 8:13 AM, Yves Dessertine <yv...@gmail.com>wrote:

> I have an (Ant) project which generates a JAR, plus a WAR for
> webservices, to port to maven. I have a question about the best
> practises:
>
> 1) I created a subproject for the webservices, ok like this?
>
> 2) The Webservices uses lots of source from my main project what's the
> best approach ? Déclare two source path (ws + parent) ? Make the WS
> subproject depend on the parent project ?
>

The WAR is your web services?  What do you use the JAR for?
Based on the limited understanding I have of your project, I'd say that
basically, you want:

myproject (pom project, no real implementation other than the two modules)
-  "myproject-jar" -- whatever this project is for; common? library? domain?
 JAR packaging.
-  "myproject-web-services" -- depends on myproject-jar as a JAR, WAR
packaging.

  - Geoffrey
--
Geoffrey Wiseman
http://www.geoffreywiseman.ca/