我有一个依赖于许多jar的项目。jar位于/lib目录中,它们不是Maven依赖项。我想将该lib目录中的所有jar添加到Maven编译目标的类路径中。我怎么能这么做?
欢呼,马丁
您可以在您的项目上创建本地存储库
例如,如果在项目结构
中有libs文件夹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>