build: replace deprecated API with suggested one for Gradle 8
build: replace deprecated API with suggested one for Gradle 8

spotbugs/spotbugs,spotbugs/spotbugs,spotbugs/spotbugs,spotbugs/spotbugs,spotbugs/spotbugs