spring_reference/VII. Spring Boot CLI/55.4. Packaging your applic...

16 lines
786 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 55.4. 应用打包
你可以使用`jar`命令打包应用程序为一个可执行的jar文件。例如
```shell
$ spring jar my-app.jar *.groovy
```
最终的jar包括编译应用产生的类和所有依赖这样你就可以使用`java -jar`来执行它了。该jar文件也包括来自应用classpath的实体。你可以使用`--include`和`--exclude`添加明确的路径(两者都是用逗号分割,同样都接收值为'+'和'-'的前缀,'-'意味着它们将从默认设置中移除。默认包含includes
```shell
public/**, resources/**, static/**, templates/**, META-INF/**, *
```
默认排除(excludes)
```shell
.*, repository/**, build/**, target/**, **/*.jar, **/*.groovy
```
查看`spring help jar`可以获得更多信息。