将文件夹中的所有jar文件添加到类路径 [英] adding all jar files in a folder to the classpath

查看:172
本文介绍了将文件夹中的所有jar文件添加到类路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了许多不同的方法,但是它们不起作用

I have tried a number of different approaches but they don't work

dependencies {
  reverseEngineer files("${projectDir}/drivers")
}

我想要的是将drivers文件夹中的所有* .jar文件添加到类路径.用户可以根据需要添加和删除驱动程序.

What I want is to add all the *.jar files in the drivers folder to the classpath. The user may add and remove drivers as necessary.

推荐答案

尝试将其作为您的依赖项添加到build.gradle文件中:

Try adding this as your dependency in your build.gradle file:

compile fileTree(include: ['*.jar'], dir: 'drivers')

这篇关于将文件夹中的所有jar文件添加到类路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆