Upgrading Gradle 6.9.3 to 7.X.X breaks because of deprecated method

So, I upgraded gradle and received an error:
"Unable to find method ‘‘java.lang.String.org.gradle.api.tasks.SourceSet.getCompileConfigurationName()’’. It looks like this method gets deprecated in new gradle versions. I’m not calling this method anywhere explicitly (from what I can see anyway), but it’s still throwing this error. Another method should be getting used instead (like getImplementationConfigurationName()), but it’s not. Any help would be appreciated.

It throws a GradleScript exception when it hits the integreationTest

testSets {
integrationTest {
dirName = ‘test-integration’
}
contractTest {
extendsFrom integrationTest
dirName = ‘test-contract’
createArtifact = true
}
}

Hello @monsie

i am new to gradle so i could miss something

so not sure if that could help or not to know what changed from in the new version as i have no idea what was there before Testing in Java & JVM projects

hope that help and have a nice day :slight_smile:

If you run with --stacktrace you should get a stacktrace that shows exactly where this method is called from.
I guess you are using some old plugin that is not compatible with Gradle 7, most probably the plugin that provides these testSets functionality.

You can either try to upgrade that plugin to a newer version if available that is compatible with Gradle 7, or in that case you could consider using the JVM Test Suite plugin instead that probably provides the functionality you were using of that old plugin.

Bjorn, you’re completely right. I had to update the plugin id ‘org.unbroken-dome.test-sets’ to version ‘4.0.0’ and make a few other changes that came along with the plugin update. Thanks.

1 Like

This was a good alternative. We’re using a different plugin though.

glad to know you figured out the issue and have a nice day :slight_smile: