Build Offline

2024-03-28

Gradle will check by default for new versions of artifacts in the repository each time you run a command. If you are working offline or for some other reason don’t want to check for updated artifacts, you can set Gradle in offline mode using the --offline flag on the command line. If you don’t want to have to remember this flag, you can either set up an alias or use an init script to set the parameter startParameter.offline=true

If you are running commands from within IntelliJ, there is also a setting for turning on and off offline mode. In some versions, select File > Settings > Build, Execution, Deployment > Build Tools > Gradle and check the box for Offline Work.

You can toggle this setting in the Gradle window as shown in this screenshot:

Related Topics