# 70.2. spring-boot:findmainclass

`findmainclass`任务是`exejar`内部用于定位声明`main`方法类的，如果构建需要，你可以直接使用该任务，支持属性如下：

| 属性            | 描述                | 是否必需                 |
| ------------- | ----------------- | -------------------- |
| `classesroot` | Java类文件的根目录       | 是（除非指定`mainclass`）   |
| `mainclass`   | 可用于缩减`main`类的查找   | 否                    |
| `property`    | Ant属性必须使用result设值 | 否（没有指定则result会记录日志中） |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jack80342.gitbook.io/spring-boot/viii.-build-tool-plugins/70.-spring-boot-antlib-module/70.2.-spring-boot-findmainclass.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
