uber / NullAway

A tool to help eliminate NullPointerExceptions (NPEs) in your Java code with low build-time overhead
MIT License
3.62k stars 290 forks source link

Maven NullAway setup not detecting anything in the project #979

Closed Wolf2323 closed 2 months ago

Wolf2323 commented 2 months ago

I am completely new to nullaway, so may this is only a bad configuration or misunderstanding of the setup but when i run my maven project with mvn verify no errors are detected in the project (I am sure there are some) even if i copy the failing example code from the readme in my code.

maven-compiler-plugin: 3.10.1 error_prone_core: 2.27.1 nullaway: 0.10.26

The complete setup I added can be seen in this PR, I already opened in my project: https://github.com/BetonQuest/BetonQuest/pull/2812/files

msridhar commented 2 months ago

Looks like you're running into #830, which I tried to address in the Error Prone docs in https://github.com/google/error-prone/pull/4162. Can you try bumping the maven-compiler-plugin version to at least 3.11.0? Alternately you can pass -Xep:NullAway:ERROR I think and you should see errors.

Please let us know if that fixes things.

Wolf2323 commented 2 months ago

Yes, updating maven-compiler-plugin solved my problem. Thank you for the fast and helpful response!