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,
- Task is ambiguous in root project gradle-examples. Candidates are: myTask1, myTask2
- How to create Gradle Multi-Project in IntelliJ
- Find installed Gradle version command
- Adding Jackson dependency to Java Gradle Project
- Gradle FAILURE: Build failed with an exception - Task not found in root project
- Create a Gradle Java Project in VS Code
- Generate Project Dependency tree using Gradle Command
- Fix: Spring Boot + IntelliJ + Gradle : Unsupported class file major version 64 Error
- Fix: Unsupported Java. Your build is currently configured to use Java 17.0.5 and Gradle 7.1.
- Run IntelliJ Java main method without Gradle build
- Fix: Deprecated Gradle features were used in this build, making it incompatible with Gradle
- Installing Gradle on macOS - Gradle Tutorial
- Fix: Invalid Gradle JDK configuration found. Could not find the required JavaSDK
- How to Clear Gradle Cache on Mac
- How to run Gradle build in offline mode
- Install Gradle VS Code for Java Projects
- How to add maven central repository in build.gradle
More Posts:
- Copy file from a remote server to current local directory system using SCP command - HowTos
- Java JDBC Connection with MySQL Driver in VS Code + Troubleshooting - Java
- How to extend retiring SharePoint 2010 Workflows and continue with Office 365 - SharePoint
- How to add hint text in bootstrap input text field and text area - Bootstrap
- How to Subscribe to AWS SNS Topic [SMS/Email/Lambda] via CLI - AWS
- How to create a Git Project in Eclipse (Step-by-step) - Eclipse
- Install Oh My Zsh on Ubuntu Docker complete steps - Ubuntu
- Selenium Maven Dependency for pom.xml - Java