Skip to content

Commit e0edc02

Browse files
author
James Lee
committed
First commit
0 parents  commit e0edc02

File tree

11 files changed

+404
-0
lines changed

11 files changed

+404
-0
lines changed

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>

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-samples</groupId>
8+
<artifactId>multi-module-parent</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+
}

src/site/apt/index.apt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Headline
2+
3+
Content

src/site/site.xml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<project name="${project.artifactId}">
2+
3+
<body>
4+
5+
<menu ref="parent" inherit="bottom"/>
6+
<menu ref="modules" inherit="bottom"/>
7+
<menu ref="reports" inherit="bottom"/>
8+
9+
</body>
10+
11+
</project>

webapp/pom.xml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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-samples</groupId>
8+
<artifactId>multi-module-parent</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
<relativePath>../pom.xml</relativePath>
11+
</parent>
12+
13+
<artifactId>webapp</artifactId>
14+
<packaging>war</packaging>
15+
<name>Webapp</name>
16+
<description>Webapp.</description>
17+
18+
<build>
19+
<finalName>${project.artifactId}</finalName>
20+
21+
<plugins>
22+
<plugin>
23+
<groupId>org.mortbay.jetty</groupId>
24+
<artifactId>jetty-maven-plugin</artifactId>
25+
</plugin>
26+
</plugins>
27+
</build>
28+
29+
<dependencies>
30+
<dependency>
31+
<groupId>${project.groupId}</groupId>
32+
<artifactId>server</artifactId>
33+
<version>${project.version}</version>
34+
</dependency>
35+
36+
<dependency>
37+
<groupId>javax.servlet</groupId>
38+
<artifactId>servlet-api</artifactId>
39+
<scope>provided</scope>
40+
</dependency>
41+
42+
<dependency>
43+
<groupId>javax.servlet.jsp</groupId>
44+
<artifactId>jsp-api</artifactId>
45+
<scope>provided</scope>
46+
</dependency>
47+
</dependencies>
48+
49+
</project>

0 commit comments

Comments
 (0)