Is it possible to offline build with gradle v. 4.10.3?

Hi!
I need to build some project completely offline with Gradle version 4.10.3 (which is required by project).
I need to build Groovy 2.5.8 from sources. For this, I downloaded these sources: https://archive.apache.org/dist/groovy/2.5.8/sources/apache-groovy-src-2.5.8.zip
Then I installed the wrapper
gradle -b wrapper.gradle wrapper
Then I changed “jcenter” to “mavenCentral” everywhere in build.gradle
Finally, I changed openbeans coordinates as described in its README https://github.com/melix/openbeans/blob/master/README.md
//compile “com.googlecode:openbeans:$openbeansVersion”
compile “me.champeau.openbeans:openbeans:1.0.2”
then I copied $USER/.gradle content to $PROJECT/grdl and run the following script:
cp -r ./grdl/ ~/.gradle*
./gradlew --offline clean dist
and got the following error:
> Task :javadocAll
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
javadoc: error - Error fetching URL: Java Platform SE 8
javadoc: error - Error fetching URL: Java(TM) EE 7 Specification APIs
javadoc: error - Error fetching URL: Apache Commons CLI 1.3.1 API
javadoc: error - Error fetching URL: JUnit API
javadoc: error - Error fetching URL: Java EE 6
javadoc: error - Error fetching URL: Generated Documentation (Untitled)
6 errors

It seems like I need to modify build script, but I have one more question: is it really possible to build the project offline using just a copy of “.gradle” folder and “–offline” key of gradlew?? Or I will meet a problem on different computer - invalidating cache for example??