我尝试将本地.jar文件依赖项添加到构建中。gradle文件:
apply plugin: 'java'
sourceSets {
main {
java {
srcDir 'src/model'
}
}
}
dependencies {
runtime files('libs/mnist-tools.jar', 'libs/gson-2.2.4.jar')
runtime fileTree(dir: 'libs', include: '*.jar')
}
您可以看到,我将.jar文件添加到这里的referencedLibraries文件夹:https://github.com/WalnutiQ/wAlnut/tree/version-2.3.1/referencedLibraries
但问题是,当我在命令行上运行命令:gradle build时,我得到以下错误:
error: package com.google.gson does not exist
import com.google.gson.Gson;
这是我的全部回购:https://github.com/WalnutiQ/wAlnut/tree/version-2.3.1