code2care@mac gradle-examples % gradle mT
FAILURE: Build failed with an exception.
* What went wrong:
Task 'mT' is ambiguous in root project 'gradle-examples'. Candidates are: 'myTask1', 'myTask2'.
* Try:
Run gradle tasks to get a list of available tasks.
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 608ms
build.gradle
task myTask1 {
doLast {
println "myTask1"
}
}
task myTask2 {
doLast {
println "myTask2"
}
}
If you are trying to use abbreviation to call a Gradle task using Camel-Casing you would get an ambiguous error if you have multiple tasks with the similar cases. As you can see I have two tasks in my build.gradle file that have a similar name - the way you can fix this issue is by calling the tasks separately.
code2care@mac gradle-examples % gradle -q myTask1 myTask2
myTask1
myTask2

Gradle Error - Task is ambiguous in root project gradle-examples. Candidates are: myTask1 myTask2
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:
- Bash Command to Check IP Address - Bash
- How to URL Encode Data for a cURL Request Parameters - cURL
- How to connect to an FTP or SFTP location using Notepad++ - NotepadPlusPlus
- Installing AWS CLI Version 2 on macOS Sonoma using Terminal - AWS
- Save current timestamp in MySQL using PHP mysqi binding - PHP
- Create S3 bucket and upload files using AWS Toolkit for Visual Studio Code - AWS
- Path of homebrew (brew) installation in macOS Big Sur - MacOS
- How to Run Gradle Build Without Unit Test Cases - Gradle