0
votes

I have a project which depends on a number of jars. The jars are located in a /lib directory and they are not Maven dependencies. I would like to add all jars in that lib dir to the classpath for the Maven compile target. How could I do this?

Cheers,

Martin

1
Start using a repository and upload those lib into the repository and start using it as dependencies. That's it.khmarbaise

1 Answers

0
votes

You may create local repository on your project

For example if you have libs folder in project structure

In libs folder you should create directory structure like: /groupId/artifactId/version/artifactId-verion.jar

In your pom.xml you should register repository

<repository>

  <id>ProjectRepo</id>
  <name>ProjectRepo</name>
  <url>file://${project.basedir}/libs</url>

</repository>

and add dependency as usual

<dependency>

   <groupId>groupId</groupId>
   <artifactId>artifactId</artifactId>
   <version>version</version>

</dependency>

That is all.