【发布时间】:2016-08-24 06:53:05
【问题描述】:
目前我正在通过 Eclipse Neo 和 STS Gradle Plugin 运行 Gradle 2.x/3.x 版本。如果在构建时出现问题,例如在 compileJava 任务中,我得到了错误的详细信息(imo 在 eclipse 的控制台选项卡中打印到 stderr,然后还有一种用于发生的构建异常的堆栈跟踪(imo 在控制台选项卡中打印到 stdout)。
这是一个示例输出:
[sts] -----------------------------------------------------
[sts] Starting Gradle build for the following tasks:
[sts] compileJava
[sts] -----------------------------------------------------
[...]
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
[sts] Build failed
org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.14-bin.zip'.
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:57)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at org.[...]
堆栈跟踪随 [sts] 一起提供,所以我认为它不是直接来自 Gradle。有没有办法抑制堆栈跟踪的打印?
【问题讨论】:
标签: java eclipse spring gradle