Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
yankils authored Dec 23, 2018
1 parent 1d3202d commit dea1202
Show file tree
Hide file tree
Showing 10 changed files with 393 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Pull base image
From tomcat:8-jre8

# Maintainer
MAINTAINER "[email protected]"
COPY ./webapp.war /usr/local/tomcat/webapps
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Hello World
# maven-project

This is a simple java web application to desplay hello world text in the browser
Simple Maven Project
220 changes: 220 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
<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.example.maven-project</groupId>
<artifactId>maven-project</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven Project</name>
<description>Sample Maven project with a working, deployable site.</description>
<url>http://www.example.com</url>

<properties>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>utf-8</project.reporting.outputEncoding>
</properties>

<modules>
<module>server</module>
<module>webapp</module>
</modules>

<distributionManagement>
<site>
<id>site-server</id>
<name>Test Project Site</name>
<url>file:///tmp/maven-project-site</url>
</site>
</distributionManagement>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>

<plugin>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>

<plugin>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<reportPlugins>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>

<plugin>
<artifactId>maven-jxr-plugin</artifactId>
</plugin>

<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>

<plugin>
<artifactId>maven-pmd-plugin</artifactId>
</plugin>

<plugin>
<artifactId>maven-surefire-report-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>taglist-maven-plugin</artifactId>
</plugin>
</reportPlugins>
</configuration>
</plugin>
</plugins>

<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.8</version>
</plugin>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</plugin>

<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
</plugin>

<plugin>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin>

<plugin>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.6</version>
</plugin>

<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.4</version>
</plugin>

<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.1</version>
</plugin>

<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
</plugin>

<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
</plugin>

<plugin>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.11</version>
</plugin>

<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.11</version>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3.3</version>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>taglist-maven-plugin</artifactId>
<version>2.4</version>
</plugin>

<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.0.0.M1</version>
</plugin>
</plugins>
</pluginManagement>
</build>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>

<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.2.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.2.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.8.5</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

<scm>
<connection>scm:git:[email protected]:jleetutorial/maven-project.git</connection>
<developerConnection>scm:git:[email protected]:jleetutorial/maven-project.git</developerConnection>
<tag>HEAD</tag>
<url>http://github.com/jleetutorial/maven-project</url>
</scm>

<prerequisites>
<maven>3.0.3</maven>
</prerequisites>

</project>
48 changes: 48 additions & 0 deletions server/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<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>

<parent>
<groupId>com.example.maven-project</groupId>
<artifactId>maven-project</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>server</artifactId>
<packaging>jar</packaging>
<name>Server</name>
<description>Logic.</description>

<build>
<finalName>${project.artifactId}</finalName>
</build>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
19 changes: 19 additions & 0 deletions server/src/main/java/com/example/Greeter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.example;

/**
* This is a class.
*/
public class Greeter {

/**
* This is a constructor.
*/
public Greeter() {

}

//TODO: Add javadoc comment
public String greet(String someone) {
return String.format("Hello, %s!", someone);
}
}
3 changes: 3 additions & 0 deletions server/src/site/apt/index.apt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Headline

Content
33 changes: 33 additions & 0 deletions server/src/test/java/com/example/TestGreeter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.example;

import org.junit.Before;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.greaterThan;
import static org.junit.Assert.assertThat;
import static org.junit.matchers.JUnitMatchers.containsString;

public class TestGreeter {

private Greeter greeter;

@Before
public void setup() {
greeter = new Greeter();
}

@Test
public void greetShouldIncludeTheOneBeingGreeted() {
String someone = "World";

assertThat(greeter.greet(someone), containsString(someone));
}

@Test
public void greetShouldIncludeGreetingPhrase() {
String someone = "World";

assertThat(greeter.greet(someone).length(), is(greaterThan(someone.length())));
}
}
44 changes: 44 additions & 0 deletions webapp/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<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>

<parent>
<groupId>com.example.maven-project</groupId>
<artifactId>maven-project</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>webapp</artifactId>
<packaging>war</packaging>
<name>Webapp</name>
<description>Webapp.</description>

<build>
<finalName>${project.artifactId}</finalName>

<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

<dependencies>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

</project>
Loading

0 comments on commit dea1202

Please sign in to comment.