# 20.2.2. 排除资源

某些资源的变化没必要触发重启，比如Thymeleaf模板可以随时编辑。默认情况下，位于`/META-INF/maven`，`/META-INF/resources`，`/resources`，`/static`，`/public`或`/templates`下的资源变更不会触发重启，但会触发实时重载（live reload）。你可以使用`spring.devtools.restart.exclude`属性自定义这些排除规则，比如，为了只排除`/static`和`/public`，你可以设置如下属性：

```
spring.devtools.restart.exclude=static/**,public/**
```

**注** 如果你想保留默认属性，并添加其他的排除规则，可以使用`spring.devtools.restart.additional-exclude`属性作为代替。


---

# 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/iii.-using-spring-boot/20.-developer-tools/20.2.-automatic-restart/20.2.2.-excluding-resources.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.
