No Cached version of com.github.jengelman.gradle.plugins:shadow:1.2.3 available for offline mode

I have the following script in my gradle.build file
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath ‘com.github.jengelman.gradle.plugins:shadow:1.2.3’
}
}

apply plugin: 'java’
apply plugin: ‘com.github.johnrengelman.shadow’


when I unchecked the ‘offline work’ Gradle has downloaded the dependency file at my local computer at location:
C:\Users\myusername\.gradle\caches\modules-2\files-2.1\com.github.jengelman.gradle.plugins\shadow\1.2.3

Under following folders:
52bbde5e384f0860df145abe24070d74dd8ed590 : folder contains file ‘shadow-1.2.3.jar’

926ed1bf3a6a2795ecc357cb265854eb6c39aa2c: folder contains file ‘shadow-1.2.3.pom’

When I choose ‘offline work’ for ‘gradle global settings’ in Intellij Idea I get the error ‘No Cached version of com.github.jengelman.gradle.plugins:shadow:1.2.3 available for offline mode’

If I uncheck offline work then it works but I want to keep that on.

Then Why gradle is not able to identify the plugin from cache location ‘C:\Users\myusername.gradle\caches’