Cant build Gradle offline

I am having issues with building Gradle in an isolated environment.
We develop the project in a lab that is not connected to the internet, we are forced to download Gradle library files from outside and push everything into the .gradle/caches folder.
However, we still cannot run gradle build and it throws the error:
“plugin org.springframework version 2.7.7 wasn’t found in any of the following sources”
As I understand it, the error is because we haven’t configured Gradle to recognize the files we downloaded, and it still tries to download the libraries as usual.
Is there a way to configure Gradle to understand and use the files we downloaded?

I’m sorry because English is not my native language.

This is not about a dependency, but about a plugin.
You probably either miss org.springframework:org.springframework.gradle.plugin:2.7.7 or its dependency.
You should also use the --offline parameter to tell Gradle not to try looking up the dependencies and plugins online.