Michael
Michael

Reputation: 715

What's a good way to bundle and add a whole bunch of JARs into a maven project?

...without specifying each and every one as a separate dependency?

So I have to work with a whole bunch of java dependencies provided by a proprietary third party software in the form of a downloadable SDK. I really want to use maven for dependency and lifecycle management, but also can't be bothered to add several dozens of JARs as individual dependencies. What's the most elegant solution to work around this issue?

Upvotes: 0

Views: 47

Answers (1)

J Fabian Meier
J Fabian Meier

Reputation: 35833

Each jar must be added as a <dependency> somewhere.

So if you have just one project that uses 100 JARs as dependencies, you need to add all those dependencies (each as a <dependency>) entry.

If you have several projects using the same JARs, I would follow Conffusion's advice to create a POM with the dependencies and then use that POM in all the projects.

Maven cannot add "a directory of JARs" to the dependencies.

Upvotes: 2

Related Questions