aksappy
aksappy

Reputation: 3400

Maven - load all jars inside a system folder

Is there a way we can load all the jar files inside a folder, as dependencies in a maven project.

So that, I do not have to mention each and every jar files in pom.xml, just mention or tell maven to pick all the jar files from folder 'x' and build the system.

Is this supported by maven?

I think this is supported by ant. Not sure whether gradle supports either.

Upvotes: 1

Views: 817

Answers (1)

J Fabian Meier
J Fabian Meier

Reputation: 35843

In

https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#System_Dependencies

you see that you can reference single files, but there is no mechanism for directories. As I mentioned in the comment, using the disk is discouraged in general.

If you need the same set of dependencies in many projects, you can write a pom for that and use it (as parent or by setting a dependency to it).

Upvotes: 1

Related Questions