Skip to content
Advertisement

Gradle build ignores Jetbrains annotations

Let’s say we have the following test code:

JavaScript

The test will pass when running gradle test directly or if IDEA delegates the action to gradle. But it will fail with IllegalArgumentException: Argument for @NotNull parameter 'value' must not be null exception if it runs using IDEA runner (not delegated to gradle).

The question is: how to fail the test running it with gradle?

Advertisement

Answer

The easiest solution I have found is to apply org.jetbrains.intellij plugin. Because among other things this plugin “patches compile tasks to instrument code with nullability assertions”.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement