From 0e7f6cec04dd77ba1ae91f43a35d3cf202aba796 Mon Sep 17 00:00:00 2001 From: coach88 Date: Wed, 29 Jul 2015 19:12:56 +0300 Subject: [PATCH] Added logging, fixed some dependencies in pom, deleted unused files. --- spring-data-mongodb/.classpath | 1 + spring-data-mongodb/pom.xml | 64 +++++++++---------- .../src/main/resources/logback.xml | 20 ++++++ .../mongoConfig.xml} | 4 +- .../src/main/webapp/WEB-INF/web.xml | 26 -------- ...ava => UserRepositoryIntegrationTest.java} | 4 +- 6 files changed, 55 insertions(+), 64 deletions(-) create mode 100644 spring-data-mongodb/src/main/resources/logback.xml rename spring-data-mongodb/src/main/{webapp/WEB-INF/dispatcher-servlet.xml => resources/mongoConfig.xml} (87%) delete mode 100644 spring-data-mongodb/src/main/webapp/WEB-INF/web.xml rename spring-data-mongodb/src/test/java/org/baeldung/repository/{UserRepositoryTest.java => UserRepositoryIntegrationTest.java} (97%) diff --git a/spring-data-mongodb/.classpath b/spring-data-mongodb/.classpath index 83dd2f44a7..8df09bc858 100644 --- a/spring-data-mongodb/.classpath +++ b/spring-data-mongodb/.classpath @@ -12,6 +12,7 @@ + diff --git a/spring-data-mongodb/pom.xml b/spring-data-mongodb/pom.xml index b4abb56fd5..d04c717916 100644 --- a/spring-data-mongodb/pom.xml +++ b/spring-data-mongodb/pom.xml @@ -4,50 +4,28 @@ org.baeldung spring-data-mongodb 0.0.1-SNAPSHOT - jar spring-data-mongodb UTF-8 - 4.1.6.RELEASE + 1.7.1.RELEASE + 4.1.7.RELEASE 1.3 4.11 2.4.1 + + 1.7.12 + 1.1.3 - - - org.springframework - spring-orm - ${org.springframework.version} - - - - org.springframework - spring-webmvc - ${org.springframework.version} - - + org.springframework.data spring-data-mongodb - 1.7.1.RELEASE - - - - jstl - jstl - 1.2 - - - - junit - junit - 3.8.1 - test + ${org.springframework.data.version} @@ -74,15 +52,33 @@ org.springframework spring-test - 3.2.0.RELEASE + ${org.springframework.version} - javax.servlet - javax.servlet-api - 3.0.1 - provided + org.slf4j + slf4j-api + ${org.slf4j.version} + + + ch.qos.logback + logback-classic + ${logback.version} + + + + org.slf4j + jcl-over-slf4j + ${org.slf4j.version} + + + + org.slf4j + log4j-over-slf4j + ${org.slf4j.version} + + diff --git a/spring-data-mongodb/src/main/resources/logback.xml b/spring-data-mongodb/src/main/resources/logback.xml new file mode 100644 index 0000000000..215eeede64 --- /dev/null +++ b/spring-data-mongodb/src/main/resources/logback.xml @@ -0,0 +1,20 @@ + + + + + web - %date [%thread] %-5level %logger{36} - %message%n + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-data-mongodb/src/main/webapp/WEB-INF/dispatcher-servlet.xml b/spring-data-mongodb/src/main/resources/mongoConfig.xml similarity index 87% rename from spring-data-mongodb/src/main/webapp/WEB-INF/dispatcher-servlet.xml rename to spring-data-mongodb/src/main/resources/mongoConfig.xml index 1b118d18d4..e9523a2ca6 100644 --- a/spring-data-mongodb/src/main/webapp/WEB-INF/dispatcher-servlet.xml +++ b/spring-data-mongodb/src/main/resources/mongoConfig.xml @@ -4,8 +4,8 @@ xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd - http://www.springframework.org/schema/context - http://www.springframework.org/schema/context/spring-context-3.2.xsd" + http://www.springframework.org/schema/context + http://www.springframework.org/schema/context/spring-context-3.2.xsd" > diff --git a/spring-data-mongodb/src/main/webapp/WEB-INF/web.xml b/spring-data-mongodb/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 79550fcbab..0000000000 --- a/spring-data-mongodb/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - dispatcher - org.springframework.web.servlet.DispatcherServlet - 1 - - - - dispatcher - / - - - - contextConfigLocation - /WEB-INF/dispatcher-servlet.xml - - - - org.springframework.web.context.ContextLoaderListener - - - \ No newline at end of file diff --git a/spring-data-mongodb/src/test/java/org/baeldung/repository/UserRepositoryTest.java b/spring-data-mongodb/src/test/java/org/baeldung/repository/UserRepositoryIntegrationTest.java similarity index 97% rename from spring-data-mongodb/src/test/java/org/baeldung/repository/UserRepositoryTest.java rename to spring-data-mongodb/src/test/java/org/baeldung/repository/UserRepositoryIntegrationTest.java index cabfa09fc1..4d29befa88 100644 --- a/spring-data-mongodb/src/test/java/org/baeldung/repository/UserRepositoryTest.java +++ b/spring-data-mongodb/src/test/java/org/baeldung/repository/UserRepositoryIntegrationTest.java @@ -17,8 +17,8 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration("file:src/main/webapp/WEB-INF/dispatcher-servlet.xml") -public class UserRepositoryTest { +@ContextConfiguration("file:src/main/resources/mongoConfig.xml") +public class UserRepositoryIntegrationTest { @Autowired private UserRepository userRepository;