Forrest logo
back to the gradle tool

gradle:tldr:dda0f

gradle: Run in offline mode to prevent Gradle from accessing the network during builds.
$ gradle build --offline
try on your machine

The command "gradle build --offline" is used in the Gradle build system to execute the build process without accessing any online resources. Here's a breakdown of what it means:

  • "gradle" refers to the Gradle executable, which is used to run tasks and manage dependencies in a Gradle project.
  • "build" is a Gradle task that instructs Gradle to execute the build process. This typically involves compiling source code, running tests, and generating artifacts.
  • "--offline" is a command-line option that tells Gradle to work in offline mode, meaning it will not attempt to connect to the internet to download dependencies or update cached artifacts.

When the "--offline" option is specified, Gradle will rely solely on the local cache to resolve dependencies. If any required dependencies are missing from the cache, and if the project has not been built before in offline mode, Gradle will not be able to resolve them and the build may fail with dependency resolution errors.

Using the "--offline" option can be useful in situations where you have limited or no internet connectivity, or when you want to ensure that your build process is not impacted by any changes in the required dependencies available online.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the gradle tool