Is there a way to import a dependency with provided scope?

I found two questions which are related to mine:

Am I right that Gradle 7.5.1 won’t import transitive dependencies if their scope is provided? For example, I have the following dependency


hadoop-client and parquet-hadoop won’t be resolved. Is there a way (with a minimal amount of scripting) to automatically resolve the version of those dependencies from provided scope?


Gradle does it like Maven and ignores provided and optional dependencies when resolving versions.
I’m not aware of an easy way to take that version.

Yes. You are right. I checked Maven behaviour and it doesn’t import provided dependencies. I thought it would. Probably those were my wrong memories. I didn’t use Maven for a while.