From 3aedfffe2f9e1ed85c3d10f6166cf650fd793a6e Mon Sep 17 00:00:00 2001 From: Ivan Chavero Date: Mon, 17 Jun 2019 11:54:48 -0500 Subject: [PATCH 1/5] Update wildfly swarm to thorntail --- java-serverhost/pom.xml | 42 ++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/java-serverhost/pom.xml b/java-serverhost/pom.xml index 39e3a1c..da2c486 100644 --- a/java-serverhost/pom.xml +++ b/java-serverhost/pom.xml @@ -8,20 +8,36 @@ 1.0 war + - 2017.10.0 - 1.8 - 1.8 - false + + UTF-8 + false + + + 2.4.0.Final + + + 3.1 + 2.16 + 2.5 + + + 1.8 + 1.8 + + - org.wildfly.swarm + io.thorntail bom-all - ${version.wildfly.swarm} + ${version.thorntail} import pom @@ -32,9 +48,9 @@ java-serverhost - org.wildfly.swarm - wildfly-swarm-plugin - ${version.wildfly.swarm} + io.thorntail + thorntail-maven-plugin + ${version.thorntail} @@ -48,6 +64,14 @@ + + io.thorntail + cdi + + + io.thorntail + jaxrs + javax From dec01143fb283d2403aed4e7d31f9e479a202e6f Mon Sep 17 00:00:00 2001 From: Ivan Chavero Date: Tue, 18 Jun 2019 16:40:15 -0500 Subject: [PATCH 2/5] Fix swarm to thorntail migration --- java-serverhost/pom.xml | 42 ++++++++--------------------------------- 1 file changed, 8 insertions(+), 34 deletions(-) diff --git a/java-serverhost/pom.xml b/java-serverhost/pom.xml index da2c486..0403048 100644 --- a/java-serverhost/pom.xml +++ b/java-serverhost/pom.xml @@ -1,6 +1,4 @@ - - + 4.0.0 com.redhat.training.example java-serverhost @@ -8,36 +6,20 @@ 1.0 war - - - - UTF-8 - false - - - 2.4.0.Final - - - 3.1 - 2.16 - 2.5 - - - 1.8 + 2.1.0.Final 1.8 - + 1.8 + false + UTF-8 - io.thorntail bom-all - ${version.thorntail} + ${version.wildfly.swarm} import pom @@ -50,7 +32,7 @@ io.thorntail thorntail-maven-plugin - ${version.thorntail} + ${version.wildfly.swarm} @@ -64,14 +46,6 @@ - - io.thorntail - cdi - - - io.thorntail - jaxrs - javax @@ -82,4 +56,4 @@ - + \ No newline at end of file From ce90e852f6b259a23f18e715a2ef02952716bdf4 Mon Sep 17 00:00:00 2001 From: Ivan Chavero Date: Wed, 19 Jun 2019 00:42:25 -0500 Subject: [PATCH 3/5] ch04s04 Update java application for thorntail --- java-serverhost/pom.xml | 20 +++++++++---------- .../javaserverhost/rest/RestApplication.java | 9 +++++++++ .../rest}/ServerHostEndPoint.java | 12 ++++++++--- 3 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 java-serverhost/src/main/java/com/redhat/training/example/javaserverhost/rest/RestApplication.java rename java-serverhost/src/main/java/com/redhat/training/example/{ => javaserverhost/rest}/ServerHostEndPoint.java (56%) diff --git a/java-serverhost/pom.xml b/java-serverhost/pom.xml index 0403048..bdb9d34 100644 --- a/java-serverhost/pom.xml +++ b/java-serverhost/pom.xml @@ -1,13 +1,15 @@ - + + 4.0.0 com.redhat.training.example java-serverhost - Java Server Host Application - 1.0 + Thorntail Example + 1.0.0-SNAPSHOT war - 2.1.0.Final + 2.4.0.Final 1.8 1.8 false @@ -19,7 +21,7 @@ io.thorntail bom-all - ${version.wildfly.swarm} + ${version.thorntail} import pom @@ -27,12 +29,12 @@ - java-serverhost + demo io.thorntail thorntail-maven-plugin - ${version.wildfly.swarm} + ${version.thorntail} @@ -46,14 +48,12 @@ - javax javaee-api 7.0 provided - - \ No newline at end of file + diff --git a/java-serverhost/src/main/java/com/redhat/training/example/javaserverhost/rest/RestApplication.java b/java-serverhost/src/main/java/com/redhat/training/example/javaserverhost/rest/RestApplication.java new file mode 100644 index 0000000..416d4a6 --- /dev/null +++ b/java-serverhost/src/main/java/com/redhat/training/example/javaserverhost/rest/RestApplication.java @@ -0,0 +1,9 @@ +package com.redhat.training.example.javaserverhost.rest; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +@ApplicationPath("/") +public class RestApplication extends Application { + +} diff --git a/java-serverhost/src/main/java/com/redhat/training/example/ServerHostEndPoint.java b/java-serverhost/src/main/java/com/redhat/training/example/javaserverhost/rest/ServerHostEndPoint.java similarity index 56% rename from java-serverhost/src/main/java/com/redhat/training/example/ServerHostEndPoint.java rename to java-serverhost/src/main/java/com/redhat/training/example/javaserverhost/rest/ServerHostEndPoint.java index e09ee8b..a5ff9c1 100644 --- a/java-serverhost/src/main/java/com/redhat/training/example/ServerHostEndPoint.java +++ b/java-serverhost/src/main/java/com/redhat/training/example/javaserverhost/rest/ServerHostEndPoint.java @@ -1,4 +1,4 @@ -package com.redhat.training.example.swarmhelloworld.rest; +package com.redhat.training.example.javaserverhost.rest; import javax.ws.rs.Path; @@ -13,8 +13,14 @@ public class ServerHostEndPoint { @GET @Produces("text/plain") - public Response doGet() throws Exception { - String host = InetAddress.getLocalHost().getHostName(); + public Response doGet() { + String host = ""; + try { + host = InetAddress.getLocalHost().getHostName(); + } + catch (Exception e) { + e.printStackTrace(); + } return Response.ok("I am running on server "+host+" Version 1.0 \n").build(); } } From 240c81958d9ed1693c367f25efdfc6ae88f28d18 Mon Sep 17 00:00:00 2001 From: Richard Allred Date: Wed, 19 Jun 2019 10:41:15 -0400 Subject: [PATCH 4/5] tweaking dependencies for thorntail --- java-serverhost/pom.xml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/java-serverhost/pom.xml b/java-serverhost/pom.xml index bdb9d34..066f368 100644 --- a/java-serverhost/pom.xml +++ b/java-serverhost/pom.xml @@ -14,6 +14,9 @@ 1.8 false UTF-8 + 3.1 + 2.16 + 2.5 @@ -28,6 +31,18 @@ + + + io.thorntail + cdi + + + io.thorntail + jaxrs + + + + demo @@ -46,14 +61,4 @@ - - - - javax - javaee-api - 7.0 - provided - - - From 95e8656462b4d014a28e0f1e7a160e8fa0c53838 Mon Sep 17 00:00:00 2001 From: Richard Allred Date: Wed, 19 Jun 2019 14:06:56 -0400 Subject: [PATCH 5/5] revert unnecessary pom changes --- java-serverhost/pom.xml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/java-serverhost/pom.xml b/java-serverhost/pom.xml index 066f368..4babfa1 100644 --- a/java-serverhost/pom.xml +++ b/java-serverhost/pom.xml @@ -14,9 +14,6 @@ 1.8 false UTF-8 - 3.1 - 2.16 - 2.5 @@ -31,18 +28,6 @@ - - - io.thorntail - cdi - - - io.thorntail - jaxrs - - - - demo @@ -61,4 +46,5 @@ +