Skip to content

Instantly share code, notes, and snippets.

@garyhodgson
Created February 8, 2018 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garyhodgson/cdf315177985b01ea4839c3a599ca0aa to your computer and use it in GitHub Desktop.
Save garyhodgson/cdf315177985b01ea4839c3a599ca0aa to your computer and use it in GitHub Desktop.
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..59dd4bc
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,43 @@
+<?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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.garyhodgson.example</groupId>
+ <artifactId>hammock-example</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <properties>
+ <maven.compiler.source>1.8</maven.compiler.source>
+ <maven.compiler.target>1.8</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.chrisdchristo</groupId>
+ <artifactId>capsule-maven-plugin</artifactId>
+ <version>1.4.3</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ <configuration>
+ <appClass>ws.ament.hammock.Bootstrap</appClass>
+ <type>fat</type>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>ws.ament.hammock</groupId>
+ <artifactId>dist-microprofile</artifactId>
+ <version>2.0</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
diff --git a/src/main/java/com/garyhodgson/example/hammock/HelloService.java b/src/main/java/com/garyhodgson/example/hammock/HelloService.java
new file mode 100644
index 0000000..bcffe69
--- /dev/null
+++ b/src/main/java/com/garyhodgson/example/hammock/HelloService.java
@@ -0,0 +1,14 @@
+package com.garyhodgson.example.hammock;
+
+import javax.enterprise.context.RequestScoped;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@RequestScoped
+@Path("/hello")
+public class HelloService {
+ @GET
+ public String sayHello() {
+ return "Hello, World!";
+ }
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment