Maven: System dependency pointing to multiple jars

Viewed 18063

Is it possible to define a dependency in the pom such that it has the scope of system but points to multiple jars?

I'm sure this is quite unorthodox, however, I was just wondering whether this was even possible. So something like:

<dependency>
  <groupId>foo</groupId>
  <artifactId>foo</artifactId>
  <version>1.0</version>
  <scope>system</scope>
  <systemPath>${basedir}/lib/foo/*.jar</systemPath>
</dependency>
4 Answers

I have a similar problem; the proprietary software I am using does not have a public Maven repository, but is packaged with close to 200 jars. I have approached the problem as follows:

cd /folder
ls *.jar > folder.txt

Then replace each line of folder.txt

^(.+)$

with

<dependency><groupId>folder</groupId><artifactId>$1</artifactId><version>1.0</version><scope>system</scope><systemPath>${folder.root}/folder/$1</systemPath></dependency>

Copy the results to your pom.xml.

Related