You need Maven to build the project and a simple `mvn package` at the root will do.
There is no need for Spring Boot Daemon on Unix thanks to the native Spring Boot support from 1.3 onwards.
The `windows` distribution uses https://github.com/kohsuke/winsw[`winsw`].
WARNING: You need to install the `.NET` framework on the target machine first.
To install the application as a service, extract the distribution zip somewhere and open a shell with administrative rights in that directory.
C:\dir> install.bat
Once the service has been installed, you can start it the usual way, that is:
C:\dir> startup.bat
C:\dir> shutdown.bat
C:\dir> run.bat
C:\dir> status.bat
Note: A result of `NonExistent` means the service is not installed.
C:\dir> shutdown.bat
C:\dir> uninstall.bat
The logs are available in the `logs` directory of the distribution.
Or, **How to convert your application into a Windows Service**.
To enable running your own Spring Boot applications as a Windows Service:
- add `net.kemitix:spring-boot-daemon-integration` as a dependency
- copy, unaltered, the `assembly` and `dist` directories from `spring-boot-daemon-sample/src/main` into your own application sources
- add the `project/build/plugins` section from `spring-boot-daemon-sample/pom.xml` to your own `pom.xml`, including the `spring-boot-maven-plugin` (needs layout=ZIP), which should be first among these plugins
- add the following properties and repositories to your `pom.xml`, updating the values to suit:
<properties>
<spring-boot.version>1.3.5.RELEASE</spring-boot.version>
<start-class>net.nicoll.SampleApplication</start-class> <!--1-->
<winsw.version>1.18</winsw.version>
<maven-dependency-plugin.version>2.10</maven-dependency-plugin.version>
<maven-resources-plugin.verion>2.7</maven-resources-plugin.verion>
<maven-assembly-plugin.version>2.6</maven-assembly-plugin.version>
<dist.dir>${project.build.directory}/dist</dist.dir>
<dist.service.name>${project.artifactId}</dist.service.name>
<dist.service.display.name>Sample Spring Boot App</dist.service.display.name> <!--2-->
<dist.service.description>
Demonstrate how to integrate a Spring Boot app as a Windows Service <!--3-->
</dist.service.description>
<dist.jar>lib\${project.artifactId}-${project.version}.jar</dist.jar>
<dist.start.class>${start-class}</dist.start.class>
<dist.jmx.port>50201</dist.jmx.port> <!--4-->
</properties>
<repositories>
<repository><!-- repo for downloading winsw.exe from -->
<id>jenkins</id>
<name>Jenkins Repository</name>
<url>http://repo.jenkins-ci.org/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
- Your Spring Boot application class
- The name that shows in the Windows Services Control Panel
- The longer description that shows in the Windows Services Control Panel
- The JMX Port on the machine that will be assigned to the server, must not conflict with another usage and is required to be able to shutdown the service