Maven fail safe plugin is not working with gradle run

I am trying to rerun the failed test scenarios from serenity with cucumber. For the retry I am using maven fail safe plugin
https://maven.apache.org/surefire/maven-failsafe-plugin/examples/rerun-failing-tests.html

Configured below properties in serenity.properties

test.retry.count=3
max.retries=4
junit.retry.tests=true
test.retry.count.cucumber=3

None of them worked with gradle. The same is worked with Maven.

I’m not sure what you are asking.
Why and how should a Maven plugin work in any way in a Gradle build?
Maybe you are after this plugin: Gradle - Plugin: org.gradle.test-retry?