# 在项目 ':app' 中未找到任务 'deploy'。可用任务：assemble, build, clean, jar, test, ...

- **ID:** `java/gradle-missing-task-definition`
- **领域:** java
- **类别:** build_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

构建脚本中未定义 'deploy' 任务，或者该任务定义在未包含的子项目中。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 7+ | active | — | — |

## 解决方案

1. **Define the 'deploy' task in the build script** (95% 成功率)
   ```
   task deploy { doLast { println 'Deploying...' } }
   ```
2. **Check the available tasks and use an existing one like 'publish'** (90% 成功率)
   ```
   gradle tasks --group build
   ```

## 无效尝试

- **Creating a custom task with the same name but no implementation** — The task will do nothing and may cause confusion. (80% 失败率)
- **Running the task in a different subproject** — The task may not exist there either, or it may be the wrong one. (70% 失败率)
