gpt4 book ai didi

Java/Groovy Gradle 构建错误

转载 作者:行者123 更新时间:2023-12-01 05:32:30 25 4
gpt4 key购买 nike

我正在尝试使用 Gradle 构建基本的 Java/Groovy 项目。我有一个 groovy 类、一个 jar 文件和 xml 文件,其文件结构如下:

项目结构:

QB/
/src/
/main/
/groovy/somefile.groovy
/lib/
/jcifs-1.3.17.jar
/config/
/config.xml
/build.gradle

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'])
}

但我不断收到此错误:

: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

有什么想法吗?

谢谢

最佳答案

jcifs-1.3.17.jar 似乎是编译依赖项,但您将其设置为运行时依赖项。

关于Java/Groovy Gradle 构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8751468/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com