Created
April 2, 2015 15:59
-
-
Save mwnorman/ed36b3c772d1973dcf1a to your computer and use it in GitHub Desktop.
aol-microservices simpleserver test 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
package com.windriver.simpleserver; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.Produces; | |
import com.aol.micro.server.auto.discovery.Rest; | |
@Rest | |
@Path("foo") | |
public class HelloResource { | |
@GET | |
@Produces("text/plain") | |
@Path("/hello") | |
public String hello() { | |
return "world"; | |
} | |
} |
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
<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.windriver.poc</groupId> | |
<artifactId>simpleserver</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<name>simpleserver</name> | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
<project.source.level>1.8</project.source.level> | |
<project.target.level>1.8</project.target.level> | |
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version> | |
<junit-version>4.11</junit-version> | |
<hamcrest-version>1.3</hamcrest-version> | |
<org.slf4j-version>1.7.12</org.slf4j-version> | |
<javax.ws.rs-version>2.0.1</javax.ws.rs-version> | |
<org.springframework-version>4.1.5.RELEASE</org.springframework-version> | |
<com.aol.microservices-version>0.53.3</com.aol.microservices-version> | |
<com.fasterxml.jackson-version>2.5.2</com.fasterxml.jackson-version> | |
<org.glassfish.grizzly-version>2.3.19</org.glassfish.grizzly-version> | |
<org.glassfish.jersey-version>2.11</org.glassfish.jersey-version> | |
</properties> | |
<repositories> | |
<repository> | |
<id>version99</id> | |
<!-- 'special' repository serving empty artifacts --> | |
<url>http://version99.qos.ch/</url> | |
</repository> | |
</repositories> | |
<dependencyManagement> | |
<dependencies> | |
<dependency> | |
<groupId>org.glassfish.jersey</groupId> | |
<artifactId>jersey-bom</artifactId> | |
<version>${org.glassfish.jersey-version}</version> | |
<type>pom</type> | |
<scope>import</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-framework-bom</artifactId> | |
<version>${org.springframework-version}</version> | |
<type>pom</type> | |
<scope>import</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.glassfish.grizzly</groupId> | |
<artifactId>grizzly-bom</artifactId> | |
<version>${org.glassfish.grizzly-version}</version> | |
<type>pom</type> | |
<scope>import</scope> | |
</dependency> | |
<dependency> | |
<groupId>commons-logging</groupId> | |
<artifactId>commons-logging</artifactId> | |
<version>99-empty</version> | |
</dependency> | |
</dependencies> | |
</dependencyManagement> | |
<dependencies> | |
<!-- Test dependencies --> | |
<dependency> | |
<groupId>junit</groupId> | |
<artifactId>junit</artifactId> | |
<version>${junit-version}</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.hamcrest</groupId> | |
<artifactId>hamcrest-core</artifactId> | |
<version>${hamcrest-version}</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.hamcrest</groupId> | |
<artifactId>hamcrest-library</artifactId> | |
<version>${hamcrest-version}</version> | |
<scope>test</scope> | |
</dependency> | |
<!-- SLF4J dependencies --> | |
<dependency> | |
<groupId>org.slf4j</groupId> | |
<artifactId>slf4j-api</artifactId> | |
<version>${org.slf4j-version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.slf4j</groupId> | |
<artifactId>jcl-over-slf4j</artifactId> | |
<version>${org.slf4j-version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.slf4j</groupId> | |
<artifactId>log4j-over-slf4j</artifactId> | |
<version>${org.slf4j-version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.slf4j</groupId> | |
<artifactId>jul-to-slf4j</artifactId> | |
<version>${org.slf4j-version}</version> | |
</dependency> | |
<!-- AOL Microservices --> | |
<dependency> | |
<groupId>com.aol.microservices</groupId> | |
<artifactId>microserver-core</artifactId> | |
<version>${com.aol.microservices-version}</version> | |
</dependency> | |
</dependencies> | |
<build> | |
<pluginManagement> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>${maven-compiler-plugin.version}</version> | |
<configuration> | |
<source>${project.source.level}</source> | |
<target>${project.target.level}</target> | |
</configuration> | |
</plugin> | |
</plugins> | |
</pluginManagement> | |
</build> | |
</project> |
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
package com.windriver.simpleserver; | |
import org.slf4j.bridge.SLF4JBridgeHandler; | |
import com.aol.micro.server.MicroserverApp; | |
public class TestMicroserverApp { | |
public static void main(String[] args) { | |
SLF4JBridgeHandler.removeHandlersForRootLogger(); | |
SLF4JBridgeHandler.install(); | |
new MicroserverApp(()->"simple").run(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment