diff --git a/build.gradle b/build.gradle
index 713d90e..8337216 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,9 +1,9 @@
group 'mybatis'
version '1.0-SNAPSHOT'
-
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'java'
+
apply plugin: 'war'
sourceCompatibility = 1.8
@@ -20,8 +20,6 @@ repositories {
}
dependencies {
- compile 'org.codehaus.groovy:groovy-all:2.3.11'
compile 'log4j:log4j:1.2.17'
- compile 'MySQL:mysql-connector-java:6.0.2'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
diff --git a/src/main/java/com/thinker/annotation/Component.java b/src/main/java/com/thinker/annotation/Component.java
new file mode 100644
index 0000000..9807322
--- /dev/null
+++ b/src/main/java/com/thinker/annotation/Component.java
@@ -0,0 +1,8 @@
+package com.thinker.annotation;
+
+/**
+ * Created by lzh on 16-6-14.
+ */
+public @interface Component {
+
+}
diff --git a/src/main/java/com/test/util/Base.java b/src/main/java/com/thinker/main/util/BaseProperty.java
similarity index 64%
rename from src/main/java/com/test/util/Base.java
rename to src/main/java/com/thinker/main/util/BaseProperty.java
index 8f7413e..410b866 100644
--- a/src/main/java/com/test/util/Base.java
+++ b/src/main/java/com/thinker/main/util/BaseProperty.java
@@ -1,20 +1,22 @@
-package com.test.util;
+package com.thinker.main.util;
import org.apache.log4j.Logger;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
+
/**
* Created by lzh on 16-6-13.
*/
-public class Base {
+public class BaseProperty {
private static Properties prop;
private static InputStream in;
- private static Logger log = Logger.getLogger(Base.class);
+ private static Logger log = Logger.getLogger(BaseProperty.class);
static {
prop = new Properties();
- in = Base.class.getResourceAsStream("/mybatis.properties");
+ log.info("加载配置文件");
+ in = BaseProperty.class.getResourceAsStream(BaseProperty.class.getResource("/").getPath()+"/mybatis.properties");
try {
prop.load(in);
} catch (IOException e) {
@@ -36,4 +38,8 @@ public class Base {
return prop.getProperty("mapper").trim();
}
+// public static void main(String[] args) {
+// System.out.println(BaseProperty.getMapper());
+// }
+
}
diff --git a/src/test/java/com/test/util/BaseTest.java b/src/test/java/com/thinker/main/util/BaseTest.java
similarity index 50%
rename from src/test/java/com/test/util/BaseTest.java
rename to src/test/java/com/thinker/main/util/BaseTest.java
index 610162e..8db5cf4 100644
--- a/src/test/java/com/test/util/BaseTest.java
+++ b/src/test/java/com/thinker/main/util/BaseTest.java
@@ -1,11 +1,10 @@
-package com.test.util;
+package com.thinker.main.util;
/**
* Created by lzh on 16-6-13.
*/
public class BaseTest {
public static void main(String[] args) {
- System.out.println(Base.getMapping());
- System.out.println(Base.getMapper());
+ System.out.println(BaseProperty.getMapper());
}
}
diff --git a/src/test/webapp/WEB-INF/web.xml b/src/test/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..3b54c58
--- /dev/null
+++ b/src/test/webapp/WEB-INF/web.xml
@@ -0,0 +1,10 @@
+
+
+