Gradle vs Maven. Behavior with java Deprecated API usage

I have big project that uses Maven as building tool. It performs install operation for about ~30 min. I decided to move to Gradle since it’s considered as faster building tool. But I faced a problem at compileJava task that looks like next :

[ERROR] [system.err] Note: /home/user/IdeaProjects/SomeClass.java uses or overrides a deprecated API.

After such errors Gradle stops build process, but Maven completes install operation successfully.

So, my question is there a way to get rid of such Gradle behavior?

[ERROR] [system.err] Note: /home/user/IdeaProjects/SomeClass.java uses or overrides a deprecated API.

This is only a warning by default from the Java compiler. Are you configuring the Java compiler to fail on warnings in Gradle, but not doing the same for Maven?