{"id":10327,"date":"2018-06-22T05:43:19","date_gmt":"2018-06-22T03:43:19","guid":{"rendered":"http:\/\/blog.wenzlaff.de\/?p=10327"},"modified":"2018-08-17T17:25:42","modified_gmt":"2018-08-17T15:25:42","slug":"wie-kann-eine-vaadin-spring-boot-app-als-linux-service-erstellt-werden","status":"publish","type":"post","link":"http:\/\/blog.wenzlaff.de\/?p=10327","title":{"rendered":"Wie kann eine Vaadin Spring Boot App als Linux Service erstellt werden?"},"content":{"rendered":"<p>Um eine Vaadin Anwendung mit <strong>Spring<\/strong> Boot und Hibernate als Linux Service einzurichten, muss zuerst ein ausf\u00fchrbares Jar erstellt werden.<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Sei-mutig-Kluft-700x525.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Sei-mutig-Kluft-700x525.png\" alt=\"\" width=\"700\" height=\"525\" class=\"aligncenter size-full wp-image-10330\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Sei-mutig-Kluft-700x525.png 700w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/06\/Sei-mutig-Kluft-700x525-300x225.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><\/p>\n<p>Daf\u00fcr muss in der <strong>pom.xml<\/strong> die Konfiguration im spring-boot-maven-plugin auf executable = true gestellt werden:<\/p>\n<pre class=\"lang:default decode:true \" >\r\n&lt;plugin&gt;\r\n\t\t\t&lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;spring-boot-maven-plugin&lt;\/artifactId&gt;\r\n\t\t\t&lt;configuration&gt;\r\n\t    \t\t&lt;executable&gt;true&lt;\/executable&gt;\r\n     \t\t&lt;\/configuration&gt;\r\n&lt;\/plugin&gt;\r\n<\/pre>\n<p>Wenn das JAR (z.B. TWSuch-0.0.1-SNAPSHOT.jar) dann mit <strong>mvn package<\/strong> erstellt wird, ist es ein selbstausf\u00fchrendes JAR.<!--more--><\/p>\n<p>Das kopieren wir dann z.B. auf den Pi:<\/p>\n<pre class=\"lang:default decode:true \" >\r\n# Erzeugen eines Verzeichnis\r\nmkdir wenzlaff.de\r\n# in das Verzeichnis wechseln\r\ncd wenzlaff.de\r\n# das Jar in das Verzeichnis kopieren\r\n# Link anlegen auf das JAR\r\nsudo ln -s \/home\/pi\/wenzlaff.de\/TWSuch-0.0.1-SNAPSHOT.jar \/etc\/init.d\/springApp\r\n\r\n# Starten der Anwendung und sonstige Befehle: {start|stop|force-stop|restart|force-reload|status|run}\r\nsudo \/etc\/init.d\/springApp start\r\n\r\n# Status abfragen\r\nsudo \/etc\/init.d\/springApp status\r\n# (Optional) das Logfile beobachten mit\r\ntail -f \/var\/log\/springApp.log\r\n\r\n# das pid File liegt dann in\r\nls -la \/var\/run\/springApp\/springApp.pid\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Um eine Vaadin Anwendung mit Spring Boot und Hibernate als Linux Service einzurichten, muss zuerst ein ausf\u00fchrbares Jar erstellt werden. Daf\u00fcr muss in der pom.xml die Konfiguration im spring-boot-maven-plugin auf executable = true gestellt werden: &lt;plugin&gt; &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt; &lt;artifactId&gt;spring-boot-maven-plugin&lt;\/artifactId&gt; &lt;configuration&gt; &lt;executable&gt;true&lt;\/executable&gt; &lt;\/configuration&gt; &lt;\/plugin&gt; Wenn das JAR (z.B. TWSuch-0.0.1-SNAPSHOT.jar) dann mit mvn package erstellt wird, ist es &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/blog.wenzlaff.de\/?p=10327\" class=\"more-link\"><span class=\"screen-reader-text\">\u201eWie kann eine Vaadin Spring Boot App als Linux Service erstellt werden?\u201c <\/span>weiterlesen<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[220,4,5,79,3285],"tags":[2178,3273,3299],"class_list":["post-10327","post","type-post","status-publish","format-standard","hentry","category-anleitung","category-eclipse","category-java","category-programmierung","category-spring-tool-suite-sts","tag-java","tag-spring-boot","tag-vaadin"],"_links":{"self":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/10327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10327"}],"version-history":[{"count":0,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/10327\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10327"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}