If you want to run the gradle build offline, you can add --offline argument with the build command,
Example:# gradle --offline build
By doing so gradle Gradle will not connect to the network to download dependencies (jars), If a dependency is not found, Gradle build will fail.
code2care@mac Desktop % gradle -offline build
> Task :app:compileJava UP-TO-DATE
> Task :app:processResources NO-SOURCE
> Task :app:classes UP-TO-DATE
> Task :app:jar UP-TO-DATE
> Task :app:startScripts UP-TO-DATE
> Task :app:distTar UP-TO-DATE
> Task :app:distZip UP-TO-DATE
> Task :app:assemble UP-TO-DATE
> Task :app:compileTestJava UP-TO-DATE
> Task :app:processTestResources NO-SOURCE
> Task :app:testClasses UP-TO-DATE
> Task :app:test UP-TO-DATE
> Task :app:check UP-TO-DATE
> Task :app:build UP-TO-DATE
BUILD SUCCESSFUL in 726ms
7 actionable tasks: 7 up-to-date
![Gradle build Offline Gradle build Offline](https://code2care.org/gradle/run-gradle-build-in-offline-mode/images/Gradle build Offline.png)
Gradle build Offline
More Posts related to Gradle,
- Run only a Single Unit Test using Gradle
- Run IntelliJ Java main method without Gradle build
- How to force re-download Gradle Dependencies
- How to Run Gradle Build Without Unit Test Cases
- Find installed Gradle version command
- Fix: Invalid Gradle JDK configuration found. Could not find the required JavaSDK
- Generate Project Dependency tree using Gradle Command
- Installing Gradle on macOS - Gradle Tutorial
- Gradle FAILURE: Build failed with an exception - Task not found in root project
- [Fix] ./gradlew: Permission denied
- Force Gradle to use specific Java JDK Version
- [fix] Deprecated gradle features were used in this build, making it incompatible with Gradle X.0
- Create a Gradle Java Project in VS Code
- Install Gradle VS Code for Java Projects
- Fix: Unsupported Java. Your build is currently configured to use Java 17.0.5 and Gradle 7.1.
- How to create Gradle Multi-Project in IntelliJ
- Fix: Spring Boot + IntelliJ + Gradle : Unsupported class file major version 64 Error
- Fix: Error: Could not find or load main class org.gradle.wrapper. GradleWrapperMain
- [fix] bash: gradlew: command not found
- [fix] Execution failed for task :core:compileJava - Could not find tools.jar
- Run Gradle Build without test cases
- How to add maven central repository in build.gradle
- Upgrade Gradle in Android Studio
- Task is ambiguous in root project gradle-examples. Candidates are: myTask1, myTask2
- Fix: Deprecated Gradle features were used in this build, making it incompatible with Gradle
More Posts:
- How to get Mac Computer Name using Terminal - MacOS
- Center align text in TextView Android Programming - Android
- Java: Reference List of Time Zones and GMT/UTC Offset - Java
- Java TLSv1.3 protocol code example using SSLSocket - Java
- Deep Dive: Java Object Class from java.lang Package - Java
- How to disable SharePoint subsite creation option for owners - SharePoint
- SharePoint Managed Metadata Hidden Taxonomy List - TaxonomyHiddenList - SharePoint
- Grep Alternative for Windows CMD or PowerShell: findstr - Windows