Skip to content

Commit

Permalink
chore: set up basic structure of the project
Browse files Browse the repository at this point in the history
  • Loading branch information
wrayzheng committed Oct 12, 2017
0 parents commit f41c66b
Show file tree
Hide file tree
Showing 17 changed files with 419 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Hidden file
.*
!.gitignore

# Compiled class file
*.class

# Target Directory
**/target/

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
29 changes: 29 additions & 0 deletions module-dao/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<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">

<parent>
<artifactId>webpage-update-subscribe</artifactId>
<groupId>com.codebelief.app</groupId>
<version>1.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>module-dao</artifactId>
<name>DAO Module</name>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.44</version>
</dependency>
</dependencies>

</project>
11 changes: 11 additions & 0 deletions module-dao/src/main/java/DAO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Hello world!
*
*/
public class DAO
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
35 changes: 35 additions & 0 deletions module-dao/src/test/java/DAOTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
* Unit test for simple App.
*/
public class DAOTest extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public DAOTest( String testName )
{
super( testName );
}

/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( DAOTest.class );
}

/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}
29 changes: 29 additions & 0 deletions module-scraper/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<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">

<parent>
<artifactId>webpage-update-subscribe</artifactId>
<groupId>com.codebelief.app</groupId>
<version>1.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>module-scraper</artifactId>
<name>Scraper Module</name>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.codebelief.app</groupId>
<artifactId>module-dao</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

</project>
11 changes: 11 additions & 0 deletions module-scraper/src/main/java/Scraper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Hello world!
*
*/
public class Scraper
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
35 changes: 35 additions & 0 deletions module-scraper/src/test/java/ScraperTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
* Unit test for simple App.
*/
public class ScraperTest extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public ScraperTest( String testName )
{
super( testName );
}

/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( ScraperTest.class );
}

/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}
34 changes: 34 additions & 0 deletions module-service/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<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">

<parent>
<artifactId>webpage-update-subscribe</artifactId>
<groupId>com.codebelief.app</groupId>
<version>1.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>module-service</artifactId>
<name>Service Module</name>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.codebelief.app</groupId>
<artifactId>module-dao</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.codebelief.app</groupId>
<artifactId>module-scraper</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

</project>
11 changes: 11 additions & 0 deletions module-service/src/main/java/Service.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Hello world!
*
*/
public class Service
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
35 changes: 35 additions & 0 deletions module-service/src/test/java/ServiceTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
* Unit test for simple App.
*/
public class ServiceTest extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public ServiceTest( String testName )
{
super( testName );
}

/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( ServiceTest.class );
}

/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}
19 changes: 19 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<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>
<artifactId>webpage-update-subscribe</artifactId>
<groupId>com.codebelief.app</groupId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Webpage Update Subscribe</name>
<url>http://app.codebelief.com/webpage-update-subscribe/</url>

<modules>
<module>webapp</module>
<module>module-scraper</module>
<module>module-service</module>
<module>module-dao</module>
</modules>

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

<parent>
<artifactId>webpage-update-subscribe</artifactId>
<groupId>com.codebelief.app</groupId>
<version>1.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>webapp</artifactId>
<name>Web Application</name>
<packaging>war</packaging>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.5.13</version>
</dependency>
<dependency>
<groupId>com.codebelief.app</groupId>
<artifactId>module-service</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<finalName>webpage-update-subscribe</finalName>
</build>

</project>
11 changes: 11 additions & 0 deletions webapp/src/main/java/WebApp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Hello world!
*
*/
public class WebApp
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
27 changes: 27 additions & 0 deletions webapp/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">

<display-name>Webpage Update Subscribe</display-name>

<!-- struts2 过滤器,将所有请求都交由 struts2 处理 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<!-- 应用的默认页面 -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<!-- 404错误页面 -->
<error-page>
<error-code>404</error-code>
<location>/error404.jsp</location>
</error-page>

</web-app>
15 changes: 15 additions & 0 deletions webapp/src/main/webapp/error404.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>页面未找到</title>
</head>

<body>
<center><h1>404 Not Found</h1></center>
</body>
</html>
15 changes: 15 additions & 0 deletions webapp/src/main/webapp/index.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>首页</title>
</head>

<body>
<center><h1>欢迎使用网页更新订阅!</h1></center>
</body>
</html>
Loading

0 comments on commit f41c66b

Please sign in to comment.