If you are trying to run your project from your IDE as you are trying to fix or develop something, it could be annoying to have the test cases run before every build as it takes up a lot of time.
If you want to skip the test cases and just perform a Gradle Build, you can do that by adding a flag -x or --exclude-task followed by test.
Windows:
./gradlew build -x test
Linux/macOS:
gradlew build -x test
![Gradle Build without test cases Gradle Build without test cases](https://code2care.org/gradle/run-gradle-build-without-test-cases/images/Gradle Build without test cases.jpg)
Facing issues? Have Questions? Post them here! I am happy to answer!
Author Info:
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
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:
- Save TextEdit file as a PDF - MacOS
- How to delete AWS SNS Subscription using CLI - AWS
- fatal: Unable to create '/c/git_repo/.git/index.lock': File exists. If no other git process is currently running, this probably means a git process crashed in this repository earlier. - Git
- Javascript convert text case from uppercase to lowercase - JavaScript
- auth_client_using_bad_version_title : Error Android Lint - Android
- Java Read and Write Properties file with Examples - Java
- Multiple ways to Convert tabs with spaces in Notepad++ - NotepadPlusPlus
- How to fix Microsoft Teams Error Code caa70004 - Teams