read_jar_source
Read Java class source from Maven JARs, handling inner classes and SNAPSHOT versions. Provide Maven coordinates and optional line range to get full or partial code with artifact details.
Instructions
读取 Maven JAR 中指定 Java 类的源码。优先使用 sources JAR;SNAPSHOT 优先读取普通包,普通包不存在时回退时间戳包。内部类使用 Outer$Inner,必要时返回外部类源码并附简短提示。默认返回全文;start_line/end_line 为从 1 开始、包含首尾的可选行范围。全文结果包含 class_name、artifact、source_type、code;分段读取附带行数信息,失败设置 isError=true。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| version | Yes | Maven 版本;SNAPSHOT 优先读取普通包,使用最新时间戳文件名管理缓存 | |
| end_line | No | ||
| group_id | Yes | Maven groupId,如 org.springframework | |
| class_name | Yes | 完整 Java 类名;内部类使用 $ | |
| start_line | No | ||
| artifact_id | Yes | Maven artifactId,如 spring-core | |
| prefer_sources | No |