将Gradle项目与工作区同步失败:任务执行失败

时间:2018-08-24 04:16:58

标签: java eclipse gradle

我正在尝试使用JAVA 8和Gradle 4.8.1将新项目导入到我的日食光子工作区中。我看到以下异常。我不确定为什么要在导入项目本身时尝试构建测试。

org.gradle.tooling.BuildException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.8.1-all.zip'.
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
    ...
Caused by: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':buildSrc:test'.
    at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
    at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
    ...
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':buildSrc:test'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
    ...
    ... 3 more
Caused by: org.gradle.api.GradleException: There were failing tests. See the report at: file:///C:/sources/elasticsearch-master/buildSrc/build-bootstrap/reports/tests/test/index.html
    at org.gradle.api.tasks.testing.AbstractTestTask.handleTestFailures(AbstractTestTask.java:612)
    at org.gradle.api.tasks.testing.AbstractTestTask.executeTests(AbstractTestTask.java:484)
    at org.gradle.api.tasks.testing.Test.executeTests(Test.java:603)
    ...
    ... 30 more

更新 两者都不起作用,但是现在正在使用4.4.1版本:

“由于引用的gradle构建中的错误,导致无法加载Gradle项目预览”

org.gradle.tooling.BuildException: Could not fetch model of type 'GradleBuild' using Gradle installation 'C:\gradle'.
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
    at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
    ...
Caused by: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':buildSrc:compileGroovy'.
    at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
    at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
    ...
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':buildSrc:compileGroovy'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
    ...
    ... 95 more
Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details.
    at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:180)
    at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:56)
    ...
    ... 3 more

0 个答案:

没有答案