[英]Java/Groovy Gradle Build Error
I'm trying to build basic Java/Groovy project using Gradle. 我正在尝试使用Gradle构建基本的Java / Groovy项目。 i have one groovy class, one jar file and and xml file with the following file structure:
我有一个具有以下文件结构的groovy类,一个jar文件和一个xml文件:
Project Structure: 项目结构:
QB/
/src/
/main/
/groovy/somefile.groovy
/lib/
/jcifs-1.3.17.jar
/config/
/config.xml
/build.gradle
The build.gradle file content: build.gradle文件的内容:
apply plugin: 'java'
apply plugin: 'groovy'
targetCompatibility = "1.6"
sourceCompatibility = "1.6"
version = "1-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
groovy group: 'org.codehaus.groovy', name: 'groovy', version: '1.8.5'
runtime fileTree(dir: 'lib', includes: ['*.jar'])
}
But i keep getting this error: 但我不断收到此错误:
:compileJava UP-TO-DATE
:compileGroovy
[ant:groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
[ant:groovyc] ..../QB/src/main/groovy/QuickBookSync.groovy: 2: unable to resolve class jcifs.smb.SmbFile
[ant:groovyc] @ line 2, column 1.
[ant:groovyc] import jcifs.smb.SmbFile
[ant:groovyc] ^
[ant:groovyc]
[ant:groovyc] ..../QB/src/main/groovy/QuickBookSync.groovy: 3: unable to resolve class jcifs.smb.SmbFileInputStream
[ant:groovyc] @ line 3, column 1.
[ant:groovyc] import jcifs.smb.SmbFileInputStream
[ant:groovyc] ^
[ant:groovyc]
[ant:groovyc] ..../QB/src/main/groovy/QuickBookSync.groovy: 1: unable to resolve class jcifs.smb.NtlmPasswordAuthentication
[ant:groovyc] @ line 1, column 1.
[ant:groovyc] import jcifs.smb.NtlmPasswordAuthentication
[ant:groovyc] ^
[ant:groovyc]
[ant:groovyc] 3 errors
[ant:groovyc]
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileGroovy'.
Cause: Forked groovyc returned error code: 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
any thoughts? 有什么想法吗?
thanks 谢谢
jcifs-1.3.17.jar
似乎是编译依赖性,但您jcifs-1.3.17.jar
其设为运行时依赖性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.