Skip to content

Commit 069920c

Browse files
authored
Add files via upload
0 parents  commit 069920c

File tree

12 files changed

+463
-0
lines changed

12 files changed

+463
-0
lines changed

Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM tomcat:latest
2+
RUN cp -R /usr/local/tomcat/webapps.dist/* /usr/local/tomcat/webapps
3+
COPY ./*.war /usr/local/tomcat/webapps
4+

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

pom.xml

+220
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.example.maven-project</groupId>
7+
<artifactId>maven-project</artifactId>
8+
<packaging>pom</packaging>
9+
<version>1.0-SNAPSHOT</version>
10+
<name>Maven Project</name>
11+
<description>Sample Maven project with a working, deployable site.</description>
12+
<url>http://www.example.com</url>
13+
14+
<properties>
15+
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
16+
<project.reporting.outputEncoding>utf-8</project.reporting.outputEncoding>
17+
</properties>
18+
19+
<modules>
20+
<module>server</module>
21+
<module>webapp</module>
22+
</modules>
23+
24+
<distributionManagement>
25+
<site>
26+
<id>site-server</id>
27+
<name>Test Project Site</name>
28+
<url>file:///tmp/maven-project-site</url>
29+
</site>
30+
</distributionManagement>
31+
32+
<build>
33+
<plugins>
34+
<plugin>
35+
<artifactId>maven-compiler-plugin</artifactId>
36+
<configuration>
37+
<source>1.6</source>
38+
<target>1.6</target>
39+
</configuration>
40+
</plugin>
41+
42+
<plugin>
43+
<artifactId>maven-release-plugin</artifactId>
44+
<configuration>
45+
<autoVersionSubmodules>true</autoVersionSubmodules>
46+
</configuration>
47+
</plugin>
48+
49+
<plugin>
50+
<artifactId>maven-site-plugin</artifactId>
51+
<configuration>
52+
<reportPlugins>
53+
<plugin>
54+
<artifactId>maven-checkstyle-plugin</artifactId>
55+
</plugin>
56+
57+
<plugin>
58+
<artifactId>maven-jxr-plugin</artifactId>
59+
</plugin>
60+
61+
<plugin>
62+
<artifactId>maven-javadoc-plugin</artifactId>
63+
</plugin>
64+
65+
<plugin>
66+
<artifactId>maven-pmd-plugin</artifactId>
67+
</plugin>
68+
69+
<plugin>
70+
<artifactId>maven-surefire-report-plugin</artifactId>
71+
</plugin>
72+
73+
<plugin>
74+
<groupId>org.codehaus.mojo</groupId>
75+
<artifactId>findbugs-maven-plugin</artifactId>
76+
</plugin>
77+
78+
<plugin>
79+
<groupId>org.codehaus.mojo</groupId>
80+
<artifactId>taglist-maven-plugin</artifactId>
81+
</plugin>
82+
</reportPlugins>
83+
</configuration>
84+
</plugin>
85+
</plugins>
86+
87+
<pluginManagement>
88+
<plugins>
89+
<plugin>
90+
<artifactId>maven-checkstyle-plugin</artifactId>
91+
<version>2.8</version>
92+
</plugin>
93+
94+
<plugin>
95+
<artifactId>maven-compiler-plugin</artifactId>
96+
<version>2.3.2</version>
97+
</plugin>
98+
99+
<plugin>
100+
<artifactId>maven-javadoc-plugin</artifactId>
101+
<version>2.8</version>
102+
</plugin>
103+
104+
<plugin>
105+
<artifactId>maven-jxr-plugin</artifactId>
106+
<version>2.3</version>
107+
</plugin>
108+
109+
<plugin>
110+
<artifactId>maven-pmd-plugin</artifactId>
111+
<version>2.6</version>
112+
</plugin>
113+
114+
<plugin>
115+
<artifactId>maven-project-info-reports-plugin</artifactId>
116+
<version>2.4</version>
117+
</plugin>
118+
119+
<plugin>
120+
<artifactId>maven-release-plugin</artifactId>
121+
<version>2.2.1</version>
122+
</plugin>
123+
124+
<plugin>
125+
<artifactId>maven-resources-plugin</artifactId>
126+
<version>2.5</version>
127+
</plugin>
128+
129+
<plugin>
130+
<artifactId>maven-site-plugin</artifactId>
131+
<version>3.0</version>
132+
</plugin>
133+
134+
<plugin>
135+
<artifactId>maven-surefire-report-plugin</artifactId>
136+
<version>2.11</version>
137+
</plugin>
138+
139+
<plugin>
140+
<artifactId>maven-surefire-plugin</artifactId>
141+
<version>2.11</version>
142+
</plugin>
143+
144+
<plugin>
145+
<groupId>org.codehaus.mojo</groupId>
146+
<artifactId>findbugs-maven-plugin</artifactId>
147+
<version>2.3.3</version>
148+
</plugin>
149+
150+
<plugin>
151+
<groupId>org.codehaus.mojo</groupId>
152+
<artifactId>taglist-maven-plugin</artifactId>
153+
<version>2.4</version>
154+
</plugin>
155+
156+
<plugin>
157+
<groupId>org.mortbay.jetty</groupId>
158+
<artifactId>jetty-maven-plugin</artifactId>
159+
<version>8.0.0.M1</version>
160+
</plugin>
161+
</plugins>
162+
</pluginManagement>
163+
</build>
164+
165+
<dependencyManagement>
166+
<dependencies>
167+
<dependency>
168+
<groupId>javax.servlet</groupId>
169+
<artifactId>servlet-api</artifactId>
170+
<version>2.5</version>
171+
</dependency>
172+
173+
<dependency>
174+
<groupId>javax.servlet.jsp</groupId>
175+
<artifactId>jsp-api</artifactId>
176+
<version>2.2</version>
177+
</dependency>
178+
179+
<dependency>
180+
<groupId>junit</groupId>
181+
<artifactId>junit-dep</artifactId>
182+
<version>4.10</version>
183+
<scope>test</scope>
184+
</dependency>
185+
186+
<dependency>
187+
<groupId>org.hamcrest</groupId>
188+
<artifactId>hamcrest-core</artifactId>
189+
<version>1.2.1</version>
190+
<scope>test</scope>
191+
</dependency>
192+
193+
<dependency>
194+
<groupId>org.hamcrest</groupId>
195+
<artifactId>hamcrest-library</artifactId>
196+
<version>1.2.1</version>
197+
<scope>test</scope>
198+
</dependency>
199+
200+
<dependency>
201+
<groupId>org.mockito</groupId>
202+
<artifactId>mockito-core</artifactId>
203+
<version>1.8.5</version>
204+
<scope>test</scope>
205+
</dependency>
206+
</dependencies>
207+
</dependencyManagement>
208+
209+
<scm>
210+
<connection>scm:git:[email protected]:jleetutorial/maven-project.git</connection>
211+
<developerConnection>scm:git:[email protected]:jleetutorial/maven-project.git</developerConnection>
212+
<tag>HEAD</tag>
213+
<url>http://github.com/jleetutorial/maven-project</url>
214+
</scm>
215+
216+
<prerequisites>
217+
<maven>3.0.3</maven>
218+
</prerequisites>
219+
220+
</project>

regapp-deploy.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: regapp
5+
labels:
6+
app: regapp
7+
8+
spec:
9+
replicas: 2
10+
selector:
11+
matchLabels:
12+
app: regapp
13+
14+
template:
15+
metadata:
16+
labels:
17+
app: regapp
18+
spec:
19+
containers:
20+
- name: regapp
21+
image: akiranreddy/regapp
22+
imagePullPolicy: Always
23+
ports:
24+
- containerPort: 8080
25+
strategy:
26+
type: RollingUpdate
27+
rollingUpdate:
28+
maxSurge: 1
29+
maxUnavailable: 1

regapp-service.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: service
5+
labels:
6+
app: regapp
7+
spec:
8+
selector:
9+
app: regapp
10+
11+
ports:
12+
- port: 8080
13+
targetPort: 8080
14+
15+
type: LoadBalancer

server/pom.xml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<parent>
7+
<groupId>com.example.maven-project</groupId>
8+
<artifactId>maven-project</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
<relativePath>../pom.xml</relativePath>
11+
</parent>
12+
13+
<artifactId>server</artifactId>
14+
<packaging>jar</packaging>
15+
<name>Server</name>
16+
<description>Logic.</description>
17+
18+
<build>
19+
<finalName>${project.artifactId}</finalName>
20+
</build>
21+
22+
<dependencies>
23+
<dependency>
24+
<groupId>junit</groupId>
25+
<artifactId>junit-dep</artifactId>
26+
<scope>test</scope>
27+
</dependency>
28+
29+
<dependency>
30+
<groupId>org.hamcrest</groupId>
31+
<artifactId>hamcrest-core</artifactId>
32+
<scope>test</scope>
33+
</dependency>
34+
35+
<dependency>
36+
<groupId>org.hamcrest</groupId>
37+
<artifactId>hamcrest-library</artifactId>
38+
<scope>test</scope>
39+
</dependency>
40+
41+
<dependency>
42+
<groupId>org.mockito</groupId>
43+
<artifactId>mockito-core</artifactId>
44+
<scope>test</scope>
45+
</dependency>
46+
</dependencies>
47+
48+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.example;
2+
3+
/**
4+
* This is a class.
5+
*/
6+
public class Greeter {
7+
8+
/**
9+
* This is a constructor.
10+
*/
11+
public Greeter() {
12+
13+
}
14+
15+
//TODO: Add javadoc comment
16+
public String greet(String someone) {
17+
return String.format("Hello, %s!", someone);
18+
}
19+
}

server/src/site/apt/index.apt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Headline
2+
3+
Content
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.example;
2+
3+
import org.junit.Before;
4+
import org.junit.Test;
5+
6+
import static org.hamcrest.CoreMatchers.is;
7+
import static org.hamcrest.Matchers.greaterThan;
8+
import static org.junit.Assert.assertThat;
9+
import static org.junit.matchers.JUnitMatchers.containsString;
10+
11+
public class TestGreeter {
12+
13+
private Greeter greeter;
14+
15+
@Before
16+
public void setup() {
17+
greeter = new Greeter();
18+
}
19+
20+
@Test
21+
public void greetShouldIncludeTheOneBeingGreeted() {
22+
String someone = "World";
23+
24+
assertThat(greeter.greet(someone), containsString(someone));
25+
}
26+
27+
@Test
28+
public void greetShouldIncludeGreetingPhrase() {
29+
String someone = "World";
30+
31+
assertThat(greeter.greet(someone).length(), is(greaterThan(someone.length())));
32+
}
33+
}

0 commit comments

Comments
 (0)