Wrapping Spring Boot application with Tanuki Service Wrapper

怎甘沉沦 提交于 2020-02-02 03:43:40

问题


How to wrap Spring Boot application as a linux daemon and to set it to read from application.properties.

To start the jar with the parameters from the application.properties I am using this command:

java -Dspring.config.location=/application.properties -jar MyJar.jar

Where to set this in wrapper.conf?

I have tried like this but the jar is not starting with the parameters from the application.properties.

wrapper.java.command=java
wrapper.java.command.loglevel=INFO
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperJarApp
wrapper.java.classpath.1=../lib/wrapper.jar
wrapper.java.classpath.2=/opt/MyService/lib/MyApp.jar
wrapper.java.library.path.1=../lib
wrapper.logfile=../logs/wrapper.log
wrapper.app.parameter.1=/opt/MyService/lib/MyApp.jar
wrapper.app.parameter.2=-c
wrapper.app.parameter.3=/opt/MyService/lib/conf

回答1:


Try with this:

wrapper.java.additional.1=-Dspring.config.location=/opt/MyService/lib/conf/application.properties


来源:https://stackoverflow.com/questions/50695561/wrapping-spring-boot-application-with-tanuki-service-wrapper

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!