|
Re: common jars in different project [message #660028 is a reply to message #659916] |
Wed, 16 March 2011 14:48 |
|
On 16-Mar-11 00:37, naresh c wrote:
> I have multiple spring project in eclipse. A lot of them use common
> jars. Some project require some specific jars and other do not required
> them. Is it possible in eclipse that i copy all the jars in a common
> location and then have some kind of config file to only pick up the
> required jars.
There are several different types of JARs and what best to do with them
depends on which type.
The first type are those that accompany the JDK. I don't think these are
those that concern you and I don't think you should do much else than
leave them as they are.
Second, the JARs that you create yourself. I don't think these concern
this question either and you can "conflate" them into a sort of
subproject (there's no such thing in Eclipse, but you can create a
project that other Eclipse projects consume or depend upon, or you can
set it up that the resulting JAR(s) of that project are consumed by
still other projects).
Third are the third-party JARs you get from various places such Apache
Commons, Spring Source, RichFaces, Hibernate, etc. I assume that these
are those of which you speak.
Typically, I create several User Libraries (Eclipse terminology) to
handle these. So, I'm not dealing with myriad copies of them, but only a
specification as to where they exist in (the one place inside) my
filesystem. The User Library is (usually) a collection of more than one
JAR. Sure, in many cases, not every JAR is useful to every consuming
project, however, there is no harm or waste.
At the risk of boring you, I suggest you might peruse this article:
http://www.javahotchocolate.com/tutorials/jars.html
In addition, you can use Maven in your project to be very exact as to
which JAR(s) is(are) consumed.
Note that there may be much else to say on this topic and many others
may have different (and in some cases even better) ideas than what I can
offer.
|
|
|
Powered by
FUDForum. Page generated in 0.08233 seconds