Gradle 8.0 compatibility warning

I am getting this warning on my gradle snippet below.

Adding a Configuration as a dependency is a confusing behavior which isn't recommended. This behaviour has been deprecated and is scheduled to be removed in Gradle 8.0. If you're interested in inheriting the dependencies from the Configuration you are adding, you should use Configuration#extendsFrom instead. See[]) for more details.

I can understand that I have to remove the dependency on the configuration but dont understand what the recommendation means or is suggesting.

configurations { 
    localDependencies {
      transitive = false
dependencies {
    localDependencies group: '', name: 'jna', version: '5.6.0'
    localDependencies group: '', name: 'jna-platform', version: '5.6.0'

    implementation configurations.localDependencies

This is because I also need the localDependencies configuration somewhere else in the script and dont want to duplicate the dependency file names.

The warning is suggesting you do:

configurations {
    localDependencies {...}
    implementation.extendsFrom( localDependencies )

However, I’m not sure if the transitive = false is going to take effect in the same way it did before, so double check the resolved implementation dependencies.

That doesn’t work. I had already tried that


causes this error:

> Could not get unknown property 'implementation' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Looks like you tried to do that inside dependencies {}. Place it inside configurations {}.