modified: build.gradle

new file:   src/main/java/com/thinker/annotation/Component.java
 	renamed:    src/main/java/com/test/util/Base.java -> src/main/java/com/thinker/main/util/BaseProperty.java
 	renamed:    src/test/java/com/test/util/BaseTest.java -> src/test/java/com/thinker/main/util/BaseTest.java
 	new file:   src/test/webapp/WEB-INF/web.xml
 	new file:   src/test/webapp/index.html
This commit is contained in:
lzh984294471 2016-06-15 00:03:34 +08:00
parent 94374c463a
commit 2e17016f8e
6 changed files with 41 additions and 10 deletions

View File

@ -1,9 +1,9 @@
group 'mybatis' group 'mybatis'
version '1.0-SNAPSHOT' version '1.0-SNAPSHOT'
apply plugin: 'groovy' apply plugin: 'groovy'
apply plugin: 'maven' apply plugin: 'maven'
apply plugin: 'java' apply plugin: 'java'
apply plugin: 'war' apply plugin: 'war'
sourceCompatibility = 1.8 sourceCompatibility = 1.8
@ -20,8 +20,6 @@ repositories {
} }
dependencies { dependencies {
compile 'org.codehaus.groovy:groovy-all:2.3.11'
compile 'log4j:log4j:1.2.17' compile 'log4j:log4j:1.2.17'
compile 'MySQL:mysql-connector-java:6.0.2'
testCompile group: 'junit', name: 'junit', version: '4.11' testCompile group: 'junit', name: 'junit', version: '4.11'
} }

View File

@ -0,0 +1,8 @@
package com.thinker.annotation;
/**
* Created by lzh on 16-6-14.
*/
public @interface Component {
}

View File

@ -1,20 +1,22 @@
package com.test.util; package com.thinker.main.util;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.Properties; import java.util.Properties;
/** /**
* Created by lzh on 16-6-13. * Created by lzh on 16-6-13.
*/ */
public class Base { public class BaseProperty {
private static Properties prop; private static Properties prop;
private static InputStream in; private static InputStream in;
private static Logger log = Logger.getLogger(Base.class); private static Logger log = Logger.getLogger(BaseProperty.class);
static { static {
prop = new Properties(); prop = new Properties();
in = Base.class.getResourceAsStream("/mybatis.properties"); log.info("加载配置文件");
in = BaseProperty.class.getResourceAsStream(BaseProperty.class.getResource("/").getPath()+"/mybatis.properties");
try { try {
prop.load(in); prop.load(in);
} catch (IOException e) { } catch (IOException e) {
@ -36,4 +38,8 @@ public class Base {
return prop.getProperty("mapper").trim(); return prop.getProperty("mapper").trim();
} }
// public static void main(String[] args) {
// System.out.println(BaseProperty.getMapper());
// }
} }

View File

@ -1,11 +1,10 @@
package com.test.util; package com.thinker.main.util;
/** /**
* Created by lzh on 16-6-13. * Created by lzh on 16-6-13.
*/ */
public class BaseTest { public class BaseTest {
public static void main(String[] args) { public static void main(String[] args) {
System.out.println(Base.getMapping()); System.out.println(BaseProperty.getMapper());
System.out.println(Base.getMapper());
} }
} }

View File

@ -0,0 +1,10 @@
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
</web-app>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
大好处把
</body>
</html>