Failed to apply plugin

Failed to apply plugin [class ‘org.gradle.api.plugins.JavaPlugin’]

Could not find method deleteAllActions() for arguments on task ‘:modules:t6:jar’ of type org.gradle.api.tasks.bundling.Jar.