Skip to content

Commit 14e79f6

Browse files
author
Pavol Liška
committed
micronaut rxjava server
1 parent fea0ec1 commit 14e79f6

File tree

6 files changed

+247
-0
lines changed

6 files changed

+247
-0
lines changed

micronaut-rxjava/micronaut-cli.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
profile: service
2+
defaultPackage: hello
3+
---
4+
testFramework: junit
5+
sourceLanguage: java

micronaut-rxjava/pom.xml

+199
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>hello</groupId>
6+
<artifactId>micronaut-rxjava</artifactId>
7+
<version>0.1.0-SNAPSHOT</version>
8+
9+
<properties>
10+
<micronaut.version>1.2.10</micronaut.version>
11+
<jdk.version>8</jdk.version>
12+
<maven.compiler.target>${jdk.version}</maven.compiler.target>
13+
<maven.compiler.source>${jdk.version}</maven.compiler.source>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
16+
<exec.mainClass>hello.ServerApp</exec.mainClass>
17+
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
18+
<maven-failsafe-plugin.version>2.22.2</maven-failsafe-plugin.version>
19+
</properties>
20+
21+
<repositories>
22+
<repository>
23+
<id>jcenter.bintray.com</id>
24+
<url>https://jcenter.bintray.com</url>
25+
</repository>
26+
</repositories>
27+
28+
<dependencyManagement>
29+
<dependencies>
30+
<dependency>
31+
<groupId>io.micronaut</groupId>
32+
<artifactId>micronaut-bom</artifactId>
33+
<version>${micronaut.version}</version>
34+
<type>pom</type>
35+
<scope>import</scope>
36+
</dependency>
37+
</dependencies>
38+
</dependencyManagement>
39+
40+
<dependencies>
41+
<dependency>
42+
<groupId>io.micronaut</groupId>
43+
<artifactId>micronaut-inject</artifactId>
44+
<scope>compile</scope>
45+
</dependency>
46+
<dependency>
47+
<groupId>io.micronaut</groupId>
48+
<artifactId>micronaut-validation</artifactId>
49+
<scope>compile</scope>
50+
</dependency>
51+
<dependency>
52+
<groupId>io.micronaut</groupId>
53+
<artifactId>micronaut-runtime</artifactId>
54+
<scope>compile</scope>
55+
</dependency>
56+
<dependency>
57+
<groupId>javax.annotation</groupId>
58+
<artifactId>javax.annotation-api</artifactId>
59+
<scope>compile</scope>
60+
</dependency>
61+
<dependency>
62+
<groupId>io.micronaut</groupId>
63+
<artifactId>micronaut-http-server-netty</artifactId>
64+
<scope>compile</scope>
65+
</dependency>
66+
<dependency>
67+
<groupId>io.micronaut</groupId>
68+
<artifactId>micronaut-http-client</artifactId>
69+
<scope>compile</scope>
70+
</dependency>
71+
<dependency>
72+
<groupId>ch.qos.logback</groupId>
73+
<artifactId>logback-classic</artifactId>
74+
<version>1.2.3</version>
75+
<scope>runtime</scope>
76+
</dependency>
77+
</dependencies>
78+
79+
<build>
80+
<plugins>
81+
<plugin>
82+
<groupId>org.apache.maven.plugins</groupId>
83+
<artifactId>maven-shade-plugin</artifactId>
84+
<version>3.1.0</version>
85+
<executions>
86+
<execution>
87+
<phase>package</phase>
88+
<goals>
89+
<goal>shade</goal>
90+
</goals>
91+
<configuration>
92+
<transformers>
93+
<transformer
94+
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
95+
<mainClass>${exec.mainClass}</mainClass>
96+
</transformer>
97+
<transformer
98+
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
99+
</transformers>
100+
</configuration>
101+
</execution>
102+
</executions>
103+
</plugin>
104+
<plugin>
105+
<groupId>org.codehaus.mojo</groupId>
106+
<artifactId>exec-maven-plugin</artifactId>
107+
<version>1.6.0</version>
108+
<configuration>
109+
<executable>java</executable>
110+
<arguments>
111+
<argument>-classpath</argument>
112+
<classpath/>
113+
<argument>-noverify</argument>
114+
<argument>-XX:TieredStopAtLevel=1</argument>
115+
<argument>-Dcom.sun.management.jmxremote</argument>
116+
117+
118+
<argument>${exec.mainClass}</argument>
119+
</arguments>
120+
</configuration>
121+
</plugin>
122+
</plugins>
123+
<pluginManagement>
124+
<plugins>
125+
<plugin>
126+
<groupId>org.apache.maven.plugins</groupId>
127+
<artifactId>maven-surefire-plugin</artifactId>
128+
<version>${maven-surefire-plugin.version}</version>
129+
<configuration>
130+
<detail>true</detail>
131+
<includes>
132+
<include>%regex[.*]</include>
133+
</includes>
134+
</configuration>
135+
</plugin>
136+
<plugin>
137+
<groupId>org.apache.maven.plugins</groupId>
138+
<artifactId>maven-failsafe-plugin</artifactId>
139+
<version>${maven-failsafe-plugin.version}</version>
140+
<executions>
141+
<execution>
142+
<goals>
143+
<goal>integration-test</goal>
144+
<goal>verify</goal>
145+
</goals>
146+
</execution>
147+
</executions>
148+
</plugin>
149+
<plugin>
150+
<groupId>org.apache.maven.plugins</groupId>
151+
<artifactId>maven-compiler-plugin</artifactId>
152+
<version>3.7.0</version>
153+
<configuration>
154+
<compilerArgs>
155+
<arg>-parameters</arg>
156+
</compilerArgs>
157+
<annotationProcessorPaths>
158+
<path>
159+
<groupId>io.micronaut</groupId>
160+
<artifactId>micronaut-inject-java</artifactId>
161+
<version>1.2.10</version>
162+
</path>
163+
<path>
164+
<groupId>io.micronaut</groupId>
165+
<artifactId>micronaut-validation</artifactId>
166+
<version>1.2.10</version>
167+
</path>
168+
</annotationProcessorPaths>
169+
</configuration>
170+
<executions>
171+
<execution>
172+
<id>test-compile</id>
173+
<goals>
174+
<goal>testCompile</goal>
175+
</goals>
176+
<configuration>
177+
<compilerArgs>
178+
<arg>-parameters</arg>
179+
</compilerArgs>
180+
<annotationProcessorPaths>
181+
<path>
182+
<groupId>io.micronaut</groupId>
183+
<artifactId>micronaut-inject-java</artifactId>
184+
<version>1.2.10</version>
185+
</path>
186+
<path>
187+
<groupId>io.micronaut</groupId>
188+
<artifactId>micronaut-validation</artifactId>
189+
<version>1.2.10</version>
190+
</path>
191+
</annotationProcessorPaths>
192+
</configuration>
193+
</execution>
194+
</executions>
195+
</plugin>
196+
</plugins>
197+
</pluginManagement>
198+
</build>
199+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package hello;
2+
3+
import io.micronaut.http.annotation.Controller;
4+
import io.micronaut.http.annotation.Get;
5+
import io.reactivex.Single;
6+
7+
@Controller("/")
8+
public class HelloController {
9+
10+
@Get("/")
11+
public Single<String> greet() {
12+
return Single.just("Hello World!");
13+
}
14+
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package hello;
2+
3+
import io.micronaut.runtime.Micronaut;
4+
5+
public class ServerApp {
6+
7+
public static void main(String[] args) {
8+
Micronaut.run(ServerApp.class);
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
micronaut:
2+
application:
3+
name: micronaut-rxjava
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<configuration>
2+
3+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
4+
<withJansi>false</withJansi>
5+
<!-- encoders are assigned the type
6+
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
7+
<encoder>
8+
<pattern>%cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n</pattern>
9+
</encoder>
10+
</appender>
11+
12+
<root level="info">
13+
<appender-ref ref="STDOUT" />
14+
</root>
15+
</configuration>

0 commit comments

Comments
 (0)