tambahkan executable di pom.xml
buat file service di /etc/systemd/system
systemctl enable <app>.service
systemctl start <app>
systemctl status <app>
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
</parent>
<dependencies>
....
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
</plugins>
</build>
buat service
buat file service di /etc/systemd/system
sudo ln -s /path/to/your-app.jar /etc/init.d/your-app
sudo service start your-app
[Unit]
Description=Dev
[Service]
User=root
# The configuration file application.properties should be here:
WorkingDirectory=/opt/project
ExecStart=/usr/bin/java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8000 -Xmx1G -jar prod.jar --server.port=8080 -Dspring.profiles.active=prod
SuccessExitStatus=143
TimeoutStopSec=10
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
systemctl enable <app>.service
systemctl start <app>
systemctl status <app>
Komentar
Posting Komentar