0

I create a Maven project , and import a jar which has no pom.xml file but has lib directory . the problem is the imported jar can't be used for jars in the lib directory cannot be finded. The Questions is how to inclued the lib directory into the new project ?

Kee
  • 1
  • 1
  • It would be useful if you included your pom.xml. Maybe this other question will help you: https://stackoverflow.com/questions/4955635/how-to-add-local-jar-files-to-a-maven-project – Federico Nafria Sep 09 '22 at 08:51
  • Please provide enough code so others can better understand or reproduce the problem. – Federico Nafria Sep 09 '22 at 08:52

1 Answers1

0

Use the system scope on a dependency:

  <dependency>
    <groupId>com.foo</groupId>
    <artifactId>foo</artifactId>
    <version>1.2.3</version>
    <scope>system</scope>
    <systemPath>${FOO_HOME}/lib/foo.jar</systemPath>
  </dependency>

The case above is also using an OS environment variable to the installation directory of the FOO software.

Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120