我在使用以下 build.gradle 文件时遇到了构建错误。
apply plugin: 'java'
apply plugin: 'idea'
sourceCompatibility = 1.7
version = '1.0'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile 'org.foo.group:my-artifact:0.0.1-final'
}
group、artifact和version都是正确的。我已经在一个Maven项目中尝试过,并且构建成功了,但在Gradle项目中出现以下错误:
:jar UP-TO-DATE
:assemble UP-TO-DATE
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':testRuntime'.
> Could not find org.foo.group:my-artifact:0.0.1-final.
Required by:
:my-gradle-project:1.0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
tlin-deploy-tool
BUILD FAILED