Could not find method classpath() for arguments [com.netflix.nebula:gradle-ospackage-plugin:8.4.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler

Hello ,
I am trying to use Gradle plugin - “com.netflix.nebula:gradle-ospackage-plugin:8.4.1”
I used to have gradle version https://services.gradle.org/distributions/gradle-4.1-all.zip

but have changed many version combination of both and i get error

Could not find method classpath() for arguments [com.netflix.nebula:gradle-ospackage-plugin:8.4.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

with my original gradle version 4.1 , I get following error

No signature of method: org.gradle.api.internal.tasks.RealizableTaskCollection.configureEach() is applicable for argument types: (com.netflix.gradle.plugins.rpm.RpmPlugin$1) values: [com.netflix.gradle.plugins.rpm.RpmPlugin$1@e
a0406c]

Can anybody help me with this please

Thanks in advance