+2  A: 

I would recommend as fewer JARs as possible.

The logic behind it, the disk storage is the cheapest commodity there available, but time spending tracing down complex dependencies is priceless.

Hence the emergence of the .war files where all dependencies of the web application are put into a single file.

BTW, Eclipse has a JAR exporter plugin which puts all dependent jars into a super jar and expose the entry level main method, so you can start your app with java -jar file.jar command. Although the resultant jar may be large, the flip side is not maintaining very complex class paths for you application.

So, in your case I would go with one jar per project. If you determine that you indeed need to reuse some code in another project, just refactor it into the base project and make it a dependency in your existent project and another project.

Alexander Pogrebnyak
Hmm, I hear you, but I want to favour re-use, and also understandability. Does anyone know if there is a performance impact of many jars?
Shaggy
+1  A: 

Java provides encapsulation and re-use at the class layer - the jar file format doesn't really provide it. I don't see much advantage in putting a significant component in its own jar, unless you think lots of people will be downloading it.

John
Yes, I know that, but should we consider an Swing component (1 main "pubic" class, plus pkg private subsidiary classes + resources) as a single "component", deliverable in isolation. I want to encourage thinking in terms of domain classes and there necessary editors (etc).
Shaggy
+1  A: 

You can actually use both approaches. Spring for example offers a big monolithic jar file, which contains most common functionality. If you want however you can also download independent jar files. It is then left to the user to select what is best. Big jar files are easier to deploy, but they are harder to upgrade. Also you may need to add a big jar whereas you only need a simple class. I find that is is easier to spot dependencies with small jar files. I also thinK that updating/upgrading is easier.

kgiannakakis
I agree with you about finding dependencies more easily with multiple jar's.
Shaggy