noircc
noircc

Reputation: 640

How to make a jar-containing jars integrable in other (eclipse-) projects?

I have jar containing jars like:

dist/my_programmed_jar  (No main)

lib/other_jars.jar (dependencies)

Is it possible to configure the manifest file, so that other projects which include the "uberjar" find the jars and can immediately work with it ( The jar doesn't contain any main, it's just for use in other projects.)

Upvotes: 0

Views: 702

Answers (1)

Aaron Digulla
Aaron Digulla

Reputation: 328780

The default Eclipse plug-in which determines the classpath cannot handle nested JARs because you need a special classloader for that.

I'm not aware of a plugin which supports this classloader, so my answer is "no".

You will have to unpack the ueberjar. I suggest to unpack it into a new Eclipse project, add all JARs to this new project's build path and the export all of them (see the "Order and Export" tab in the "Java Build Path" project settings).

You can now add this new project to all other projects as a dependency (see the "Projects" tab in the "Java Build Path" project settings).

Upvotes: 1

Related Questions