forked from RedHatTraining/DO288-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0099034
commit ef8c52b
Showing
3 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.redhat.training.example</groupId> | ||
<artifactId>quip</artifactId> | ||
<name>An application that prints a quip</name> | ||
<version>1.0</version> | ||
<packaging>war</packaging> | ||
|
||
<properties> | ||
<version.wildfly.swarm>2.1.0.Final</version.wildfly.swarm> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<failOnMissingWebXml>false</failOnMissingWebXml> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.thorntail</groupId> | ||
<artifactId>bom-all</artifactId> | ||
<version>${version.wildfly.swarm}</version> | ||
<scope>import</scope> | ||
<type>pom</type> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<build> | ||
<finalName>quip</finalName> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.thorntail</groupId> | ||
<artifactId>thorntail-maven-plugin</artifactId> | ||
<version>${version.wildfly.swarm}</version> | ||
|
||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>package</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
<!-- Java EE 7 dependency --> | ||
<dependency> | ||
<groupId>javax</groupId> | ||
<artifactId>javaee-api</artifactId> | ||
<version>7.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<!-- WildFly Swarm Fractions --> | ||
|
||
</dependencies> | ||
</project> |
8 changes: 8 additions & 0 deletions
8
quip/src/main/java/com/redhat/training/example/JaxRsActivator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.redhat.training.example; | ||
|
||
import javax.ws.rs.ApplicationPath; | ||
import javax.ws.rs.core.Application; | ||
|
||
@ApplicationPath("/") | ||
public class JaxRsActivator extends Application { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.redhat.training.example; | ||
|
||
import javax.ws.rs.Path; | ||
import javax.ws.rs.core.Response; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Produces; | ||
import java.net.InetAddress; | ||
|
||
|
||
@Path("/") | ||
public class Quip { | ||
|
||
@GET | ||
@Produces("text/plain") | ||
public Response index() throws Exception { | ||
String host = InetAddress.getLocalHost().getHostName(); | ||
return Response.ok("Veni, vidi, vici...\n").build(); | ||
} | ||
|
||
@GET | ||
@Path("/ready") | ||
@Produces("text/plain") | ||
public Response ready() throws Exception { | ||
return Response.ok("OK\n").build(); | ||
} | ||
|
||
} | ||
|