How to make gradle work offline with few simple config steps

Using --offline should result in the behavior you want. How are you executing this build? Are you using the Gradle wrapper?