how to include jars in a jar which is not a maven project into a maven project

Viewed 11

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 ?

1 Answers

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.

Related