{"id":8993,"date":"2017-10-12T20:04:23","date_gmt":"2017-10-12T18:04:23","guid":{"rendered":"http:\/\/blog.wenzlaff.de\/?p=8993"},"modified":"2024-04-26T18:11:50","modified_gmt":"2024-04-26T16:11:50","slug":"wie-kann-ein-jee-8-projekt-mit-glassfish-v5-in-docker-mit-eclipse-oxygen-in-5-minuten-mit-archetyp-erstellt-werden","status":"publish","type":"post","link":"http:\/\/blog.wenzlaff.de\/?p=8993","title":{"rendered":"Wie kann ein JEE 8 Projekt mit GlassFish v5 in Docker mit Eclipse Oxygen in 5 Minuten mit Archetyp erstellt werden?"},"content":{"rendered":"<p>Wer mal eben schnell ein JEE 8 Projekt mit <a href=\"https:\/\/javaee.github.io\/glassfish\/\" rel=\"noopener noreferrer\" target=\"_blank\">GlassFish Server<\/a> in einem <a href=\"https:\/\/www.docker.com\/\" rel=\"noopener noreferrer\" target=\"_blank\">Docker<\/a> Kontainer erstellen will, kann das leicht mit dem Archtype <strong>com.airhacks<\/strong> von Adam Bien tun.<\/p>\n<p>Voraussetzung ist <strong>Eclipse Oxygen<\/strong> (<a href=\"http:\/\/kleinhirn.eu\/2017\/09\/28\/eclipse-oxygen\/\" rel=\"noopener noreferrer\" target=\"_blank\">Mindmap<\/a>) mit <strong>Java 1.8<\/strong> und <strong>Docker<\/strong>.<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Docker-only.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Docker-only.png\" alt=\"\" width=\"3508\" height=\"2480\" class=\"aligncenter size-full wp-image-9016\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Docker-only.png 3508w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Docker-only-300x212.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Docker-only-768x543.png 768w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Docker-only-1024x724.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Was ist zu tun?<\/p>\n<p>1. Ein neues Mavenprojekt starten \u00fcber das Men\u00fc: <strong>New &#8211; Other &#8211; Maven Projekt<\/strong> &#8230;<!--more--><\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.24.45.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.24.45.png\" alt=\"\" width=\"526\" height=\"499\" class=\"aligncenter size-full wp-image-8994\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.24.45.png 526w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.24.45-300x285.png 300w\" sizes=\"auto, (max-width: 526px) 100vw, 526px\" \/><\/a><\/p>\n<p><strong>Next<\/strong><\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-18.58.31.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-18.58.31.png\" alt=\"\" width=\"827\" height=\"535\" class=\"aligncenter size-full wp-image-8996\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-18.58.31.png 827w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-18.58.31-300x194.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-18.58.31-768x497.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p><strong>Next<\/strong><\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-18.58.46.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-18.58.46.png\" alt=\"\" width=\"826\" height=\"537\" class=\"aligncenter size-full wp-image-8999\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-18.58.46.png 826w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-18.58.46-300x195.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-18.58.46-768x499.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p><strong>com.airhacks<\/strong> mit Version <strong>0.0.2<\/strong> ausw\u00e4hlen und <strong>Next<\/strong><\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-18.59.42.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-18.59.42.png\" alt=\"\" width=\"826\" height=\"535\" class=\"aligncenter size-full wp-image-9000\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-18.59.42.png 826w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-18.59.42-300x194.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-18.59.42-768x497.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p><strong>de.wenzlaff.jee<\/strong> f\u00fcr Group Id, Artifact Id und Package eingeben und <strong>Finish<\/strong>.<\/p>\n<p>Nach ein paar Sekunden haben wir das Projekt in dieser Form:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.00.12.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.00.12.png\" alt=\"\" width=\"272\" height=\"190\" class=\"aligncenter size-full wp-image-9001\" \/><\/a><\/p>\n<p>2. Auf das Projekt ein Maven: <strong>mvn clean install<\/strong> durchf\u00fchren.<br \/>\n<a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.31.56.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.31.56.png\" alt=\"\" width=\"1390\" height=\"670\" class=\"aligncenter size-full wp-image-9002\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.31.56.png 1390w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.31.56-300x145.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.31.56-768x370.png 768w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.31.56-1024x494.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>3. So, jetzt das docker image bauen und starten. Auf der Konsole im Projekt-Verzeichnis:<\/p>\n<pre class=\"lang:default decode:true \" >\r\ndocker build -t de.wenzlaff.jee\/de.wenzlaff.jee .\r\ndocker run -d -p 8080:8080 -p 4848:4848 --name de.wenzlaff.jee de.wenzlaff.jee\/de.wenzlaff.jee\r\n# testen ob der Server l\u00e4uft mit\r\ndocker ps\r\n<\/pre>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.36.07.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.36.07.png\" alt=\"\" width=\"1277\" height=\"219\" class=\"aligncenter size-full wp-image-9003\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.36.07.png 1277w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.36.07-300x51.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.36.07-768x132.png 768w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.36.07-1024x176.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>In der Docker Explorer View von Eclipse l\u00e4uft es auch:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.45.29.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.45.29.png\" alt=\"\" width=\"968\" height=\"246\" class=\"aligncenter size-full wp-image-9007\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.45.29.png 968w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.45.29-300x76.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.45.29-768x195.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Oder als Kontainer:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.46.48.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.46.48.png\" alt=\"\" width=\"1351\" height=\"177\" class=\"aligncenter size-full wp-image-9008\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.46.48.png 1351w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.46.48-300x39.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.46.48-768x101.png 768w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.46.48-1024x134.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>4. Nun kann im Browser getestet werden, ob der Server mit <strong>http:\/\/localhost:8080<\/strong> und die erste Seite l\u00e4uft:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.14.20.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.14.20.png\" alt=\"\" width=\"973\" height=\"442\" class=\"aligncenter size-full wp-image-9004\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.14.20.png 973w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.14.20-300x136.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.14.20-768x349.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>und die 1. Seite mit <strong>http:\/\/localhost:8080\/de.wenzlaff.jee\/resources\/ping<\/strong><\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.21.22.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.21.22.png\" alt=\"\" width=\"688\" height=\"96\" class=\"aligncenter size-full wp-image-9006\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.21.22.png 688w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/10\/Bildschirmfoto-2017-10-12-um-19.21.22-300x42.png 300w\" sizes=\"auto, (max-width: 688px) 100vw, 688px\" \/><\/a><\/p>\n<p>Auf <a href=\"https:\/\/adambien.blog\/roller\/abien\/entry\/simplest_possible_java_ee_8\" rel=\"noopener noreferrer\" target=\"_blank\">dieser<\/a> Seite, findet ihr noch ein Video, wo Adam Bien das in 1,5 Minuten mit <a href=\"https:\/\/netbeans.apache.org\/front\/main\/index.html\">NetBeans<\/a> macht. Ich bin begeistert! Und Ihr?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wer mal eben schnell ein JEE 8 Projekt mit GlassFish Server in einem Docker Kontainer erstellen will, kann das leicht mit dem Archtype com.airhacks von Adam Bien tun. Voraussetzung ist Eclipse Oxygen (Mindmap) mit Java 1.8 und Docker. Was ist zu tun? 1. Ein neues Mavenprojekt starten \u00fcber das Men\u00fc: New &#8211; Other &#8211; Maven &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/blog.wenzlaff.de\/?p=8993\" class=\"more-link\"><span class=\"screen-reader-text\">\u201eWie kann ein JEE 8 Projekt mit GlassFish v5 in Docker mit Eclipse Oxygen in 5 Minuten mit Archetyp erstellt werden?\u201c <\/span>weiterlesen<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[220,2791,4,1361,2914,79],"tags":[2502,3029,2178,2793],"class_list":["post-8993","post","type-post","status-publish","format-standard","hentry","category-anleitung","category-docker","category-eclipse","category-java-8","category-oxygen","category-programmierung","tag-docker","tag-glasfish","tag-java","tag-kontainer"],"_links":{"self":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/8993","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=8993"}],"version-history":[{"count":0,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/8993\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8993"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}