Set up Error Prone check to prevent use of native Gradle and Maven loggers
See original GitHub issueUsing the native Gradle logger was probably why our deprecation messages were overwritten.
We should be careful not to make use of the native Maven or Gradle loggers. We can prevent misuse in ProjectProperties
by just using consoleLogger
. But it is very easy to accidentally use the native loggers in Maven mojos and Gradle tasks. Unfortunately, now I realized we had used the native loggers when printing deprecation notices.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
how to setup error prone with gradle (getting various errors)
Solved as below. Add Gradle plugin to build.gradle file. plugins { id("net.ltgt.errorprone") version "1.1.0" }. Release versions.
Read more >Upgrading your build from Gradle 7.x to the latest
Try running gradle help --scan and view the deprecations view of the generated build scan. Deprecations View of a Gradle Build Scan. This...
Read more >Upgrading your build from Gradle 5.x to 6.0
Try running gradle help --scan and view the deprecations view of the generated build scan. Deprecations View of a Gradle Build Scan. This...
Read more >userguide.pdf - Gradle User Manual
In most use cases, you'll use existing tasks. Gradle provides tasks that implement many common build system needs, like the built-in Java Test...
Read more >Testing in Java & JVM projects - Gradle User Manual
If you don't want to use test class detection, you can disable it by setting the scanForTestClasses property on Test to false ....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think we can ask error prone to mark any use of the gradle logger or maven logger as unsafe in our codebase, just speculating though. (we would write this check)
I tried to see how Error Prone can be configured to detect this. Looks like we have to write a custom check in Java. This seems fairly involved. May need to create another Gradle sub-project. I’ll rename this issue and add the “tech debt” label to be open.