> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/viii.-build-tool-plugins/70.-spring-boot-antlib-module/70.1.-spring-boot-ant-tasks/70.1.1.-spring-boot-exejar.md).

# 70.1.1. spring-boot:exejar

`exejar`任务可用于创建Spring Boot可执行jar，该任务支持以下属性：

| 属性            | 描述           | 是否必须                     |
| ------------- | ------------ | ------------------------ |
| `destfile`    | 将要创建的目的jar文件 | 是                        |
| `classes`     | Java类文件的根目录  | 是                        |
| `start-class` | 运行的main类     | 否（默认为找到的第一个声明`main`方法的类） |

以下元素可以跟任务一块使用：

| 元素          | 描述                                                                                                                                                                    |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `resources` | 一个或多个[Resource Collections](https://ant.apache.org/manual/Types/resources.html#collection)，描述将添加到创建的jar文件中的[资源](https://ant.apache.org/manual/Types/resources.html)集合 |
| `lib`       | 一个或多个[Resource Collections](https://ant.apache.org/manual/Types/resources.html#collection)，表示需要添加进jar库的集合，组成了应用运行时的classpath依赖                                        |
