Setup a spring boot application to run on windows as a service
Reference links
https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html
https://github.com/kohsuke/winsw/blob/master/doc/installation.md
https://github.com/snicoll-scratches/spring-boot-daemon
Basically, winsw provide a way to make executable to run as a windows service.
Tips,
- Check winsw log for the real command being run
- Security (run as certain user from the service)
A basic example,
1 | <service> |
externalize spring config file
https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html
for example,
–spring.config.location=/opt/myconfig.properties