'How to capture compilation errors and warnings in SBT

My purpose is to write all compile warnings and errors to a file, that will be shown as a report file in Jenkins.

In this way, it is more clear to see the output of many tasks running in parallel.

How can I accomplish this with the compile task?

UPDATE:

I've researched a little and found:

  • compilerReporter, but is is declared as private. So it cannot be used.
  • bspReporter task, that I don't know how to override
sbt


Solution 1:[1]

The clue is to use the compilerReporter task. As this task is defined as private[sbt], the only choice is to create within the project an AutoPlugin in the sbt package.

This plugin will be responsible of overriding the default value of the task, and will have no problems as it is in the same package.

More info here: https://github.com/sbt/sbt/pull/5948

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 david.perez