{
  "id": "java/gradle-missing-test-framework",
  "signature": "Could not find method testImplementation() for arguments [junit:junit:4.13.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.",
  "signature_zh": "在 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 类型的对象上找不到方法 testImplementation()，参数为 [junit:junit:4.13.2]。",
  "regex": "Could\\ not\\ find\\ method\\ testImplementation\\(\\)\\ for\\ arguments\\ \\[junit:junit:4\\.13\\.2\\]\\ on\\ object\\ of\\ type\\ org\\.gradle\\.api\\.internal\\.artifacts\\.dsl\\.dependencies\\.DefaultDependencyHandler\\.",
  "domain": "java",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "The 'testImplementation' configuration is used in a project that does not apply the Java plugin, which provides the test configurations.",
  "root_cause_type": "generic",
  "root_cause_zh": "在未应用 Java 插件的项目中使用了 'testImplementation' 配置，该插件提供测试配置。",
  "versions": [
    {
      "version": "7+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Adding testImplementation to the root project without applying the Java plugin",
      "why_fails": "The test configuration is only available after applying the Java plugin.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using compileOnly instead of testImplementation",
      "why_fails": "compileOnly does not include the dependency in the test classpath.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Apply the Java plugin to the project",
      "success_rate": 0.95,
      "how": "plugins { id 'java' }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use the 'test' configuration if the Java plugin is not desired (deprecated)",
      "success_rate": 0.7,
      "how": "testCompile 'junit:junit:4.13.2' (though deprecated, works in older Gradle)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-12-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}