Springboot project, packaged directly into jars
With Tomcat, you can run directly from Java commands without web App service.
For Maven, for example, configure the packaged output type in Pom.xml:
<packaging>jar</packaging>
Configuration build:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Once packaged as a jar, it can be started or stopped directly through batch processing.
Window-bat
Start
@echo off
: WMIC process where "commandline like '%%-jar reportcheck%% '" Call terminate
Set path=C:\Program files\java\jre1.8.0_91\bin
Reportcheck-0.0.1-snapshot.jar
Pause
Stop
@echo off
reportcheck' "Call terminate
Pause
Unix-sh
Start
#!/bin/bash
If PS aux | Grep-v ' grep ' | grep ' java ' | grep ' Reportcheck.jar '
Then
pid=$ (ps aux | grep-v ' grep ' |grep ' java ' |grep ' Reportcheck.jar ' | awk ' {print $} ');
echo pid;
Kill-9 ${pid};
echo Old Reportcheck exit ...;
Fi
Nohup Java-jar Reportcheck.jar &> out &
Echo Reportcheck running ...
Stop
#!/bin/bash
If PS aux | Grep-v ' grep ' | grep ' java ' | grep ' Reportcheck.jar '
Then
pid=$ (ps aux | grep-v ' grep ' |grep ' java ' |grep ' Reportcheck.jar ' | awk ' {print $} ');
Echo PID
Kill-9 ${pid};
Fi
Jar background Run script window-bat/unix-sh for Springboot