Skip to content

Commit a5c6593

Browse files
committed
Add ratpack test
1 parent 8683b61 commit a5c6593

File tree

3 files changed

+159
-0
lines changed

3 files changed

+159
-0
lines changed

ratpack/dependency-reduced-pom.xml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.example</groupId>
5+
<artifactId>ratpack</artifactId>
6+
<version>0.0.1-SNAPSHOT</version>
7+
<build>
8+
<defaultGoal>install</defaultGoal>
9+
<directory>target</directory>
10+
<finalName>${project.artifactId}-${project.version}</finalName>
11+
<plugins>
12+
<plugin>
13+
<artifactId>maven-compiler-plugin</artifactId>
14+
<version>2.5.1</version>
15+
<configuration>
16+
<source>${java.version}</source>
17+
<target>${java.version}</target>
18+
</configuration>
19+
</plugin>
20+
<plugin>
21+
<artifactId>maven-shade-plugin</artifactId>
22+
<version>2.4.3</version>
23+
<executions>
24+
<execution>
25+
<phase>package</phase>
26+
<goals>
27+
<goal>shade</goal>
28+
</goals>
29+
<configuration>
30+
<transformers>
31+
<transformer />
32+
</transformers>
33+
</configuration>
34+
</execution>
35+
</executions>
36+
</plugin>
37+
<plugin>
38+
<artifactId>maven-jar-plugin</artifactId>
39+
<version>2.6</version>
40+
<configuration>
41+
<archive>
42+
<manifest>
43+
<mainClass>Example</mainClass>
44+
</manifest>
45+
</archive>
46+
</configuration>
47+
</plugin>
48+
<plugin>
49+
<groupId>org.codehaus.mojo</groupId>
50+
<artifactId>exec-maven-plugin</artifactId>
51+
<version>1.4.0</version>
52+
<configuration>
53+
<executable>java</executable>
54+
<arguments>
55+
<argument>-jar</argument>
56+
<argument>target/${project.build.finalName}.jar</argument>
57+
</arguments>
58+
</configuration>
59+
</plugin>
60+
</plugins>
61+
</build>
62+
<properties>
63+
<java.version>1.8</java.version>
64+
</properties>
65+
</project>
66+

ratpack/pom.xml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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+
6+
<groupId>com.example</groupId>
7+
<artifactId>ratpack</artifactId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
10+
<properties>
11+
<java.version>1.8</java.version>
12+
</properties>
13+
14+
<dependencies>
15+
<dependency>
16+
<groupId>io.ratpack</groupId>
17+
<artifactId>ratpack-core</artifactId>
18+
<version>1.4.4</version>
19+
</dependency>
20+
</dependencies>
21+
22+
23+
<build>
24+
<defaultGoal>install</defaultGoal>
25+
<directory>target</directory>
26+
<finalName>${project.artifactId}-${project.version}</finalName>
27+
<plugins>
28+
<plugin>
29+
<groupId>org.apache.maven.plugins</groupId>
30+
<artifactId>maven-compiler-plugin</artifactId>
31+
<version>2.5.1</version>
32+
<configuration>
33+
<source>${java.version}</source>
34+
<target>${java.version}</target>
35+
</configuration>
36+
</plugin>
37+
<plugin>
38+
<groupId>org.apache.maven.plugins</groupId>
39+
<artifactId>maven-shade-plugin</artifactId>
40+
<version>2.4.3</version>
41+
<executions>
42+
<execution>
43+
<phase>package</phase>
44+
<goals>
45+
<goal>shade</goal>
46+
</goals>
47+
<configuration>
48+
<transformers>
49+
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
50+
</transformers>
51+
</configuration>
52+
</execution>
53+
</executions>
54+
</plugin>
55+
<plugin>
56+
<groupId>org.apache.maven.plugins</groupId>
57+
<artifactId>maven-jar-plugin</artifactId>
58+
<version>2.6</version>
59+
<configuration>
60+
<archive>
61+
<manifest>
62+
<mainClass>Example</mainClass>
63+
</manifest>
64+
</archive>
65+
</configuration>
66+
</plugin>
67+
<plugin>
68+
<groupId>org.codehaus.mojo</groupId>
69+
<artifactId>exec-maven-plugin</artifactId>
70+
<version>1.4.0</version>
71+
<configuration>
72+
<executable>java</executable>
73+
<arguments>
74+
<argument>-jar</argument>
75+
<argument>target/${project.build.finalName}.jar</argument>
76+
</arguments>
77+
</configuration>
78+
</plugin>
79+
</plugins>
80+
</build>
81+
82+
</project>

ratpack/src/main/java/Example.java

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import ratpack.server.RatpackServer;
2+
3+
public class Example {
4+
public static void main(String... args) throws Exception {
5+
6+
RatpackServer
7+
.start(server -> server
8+
.handlers(chain -> chain
9+
.get(ctx -> ctx.render("Hello World!"))));
10+
}
11+
}

0 commit comments

Comments
 (0)