Skip to content

Commit 337fc75

Browse files
authored
Update 56.1.3 Customizing the startup script.md
1 parent 0e289a6 commit 337fc75

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed
Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1-
###56.1.3 Customizing the startup script
1+
###56.1.3 自定义启动脚本
2+
Maven或Gradle插件编写的默认内嵌启动脚本可以通过很多方法自定义,对于大多数开发者,使用默认脚本和一些自定义通常就足够了。如果发现不能自定义需要的东西,你可以使用`embeddedLaunchScript`选项编写自己的文件。
3+
4+
**在脚本编写过程中自定义**
5+
自定义写入jar文件的启动脚本元素是有意义的,例如,为`init.d`脚本提供`description`,既然知道这会展示到前端,你可能会在生成jar时提供它。
6+
7+
为了自定义写入的元素,你需要为Spring Boot Maven或Gradle插件指定`embeddedLaunchScriptProperties`选项。
8+
9+
以下是默认脚本支持的可代替属性:
10+
11+
|名称|描述|
12+
|:---|:----|
13+
|`mode`|脚本模式,默认为`auto`|
14+
|`initInfoProvides`|'INIT INFO'部分的`Provides`,对于Gradle默认为`spring-boot-application`,对于Maven默认为`${project.artifactId}`|
15+
|`initInfoShortDescription`|‘INIT INFO’部分的`Short-Description`,对于Gradle默认为`Spring Boot Application`,对于Maven默认为`${project.name}`|
16+
|`initInfoDescription`|“INIT INFO”部分的`Description`,对于Gradle默认为`Spring Boot Application`,对于Maven默认为`${project.description}`(失败会回退到`${project.name}`|
17+
|`initInfoChkconfig`|“INIT INFO”部分的`chkconfig`,默认为`2345 99 01`|
18+
|`confFolder`|`CONF_FOLDER`的默认值,默认为包含jar的文件夹|
19+
|`logFolder`|`LOG_FOLDER`的默认值,只对`init.d`服务有效|
20+
|`pidFolder`|`PID_FOLDER`的默认值,只对`init.d`服务有效|
21+
|`useStartStopDaemon`|如果`start-stop-daemon`命令可用,它会控制该进程,默认为`true`|

0 commit comments

Comments
 (0)