springboot打包,jar包可以以service方式启动

 <build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<!-- 可以发不成linux服务包,直接用linux的servic命令启动 -->
					<executable>true</executable>
				</configuration>
			</plugin>
		</plugins>
	</build>

需要做软连接
ln -sb 原文件 /etc/init.d/服务名

然后 设置权限

启动:

service 服务名 start|stop|status|restart

猜你喜欢

转载自www.cnblogs.com/liangblog/p/10843192.html