Koenigsberg
Koenigsberg

Reputation: 1798

Stacktrace option for Gradle task in Eclipse

A Gradle task classesPipeline is being run in Eclipse. This task assembles .class files by depending on the standard classes task, then attempts executing a batchfile.

All goes fine until the batchfile, where the script dies a horrible death in Eclipse, by printing to console:

Execution failed for task ':classesPipeline'.
> A problem occurred starting process 'command '../SomeFolder/SomeBatchfile.bat''

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

The log suggests to run the task with --stacktrace, but how do I do this?

So I checked the project settings, the Gradle section offers no command line arguments, as far as i see. It is noteworthy, that running the task with --stacktrace via gradlew is of no value to me, because the task executes just fine in this case, this is only happening in Eclipse specifically.

TL;DR:

How can a gradle task be executed from Eclipse, while passing arguments to it?

Upvotes: 2

Views: 6657

Answers (1)

Koenigsberg
Koenigsberg

Reputation: 1798

To anyone who may come into contact with this problem:

I found the solution in a different, but closely related question:

How can I make "gradle --stacktrace" the default?

It is sufficient to add the following to the build.gradle:

gradle.startParameter.showStacktrace = org.gradle.api.logging.configuration.ShowStacktrace.ALWAYS

Upvotes: 3

Related Questions