petclinic-uncached
Changes
pom.xml 208(+82 -126)
src/main/resources/logback.xml 12(+4 -8)
src/main/webapp/WEB-INF/web.xml 113(+57 -56)
src/test/resources/logback-test.xml 23(+23 -0)
Details
pom.xml 208(+82 -126)
diff --git a/pom.xml b/pom.xml
index e3dafdc..d58492d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,21 +11,10 @@
<properties>
<antlr.version>2.7.7</antlr.version>
- <asm.version>3.3.1</asm.version>
<aspectj.version>1.7.1</aspectj.version>
<commons-beanutils.version>1.8.3</commons-beanutils.version>
- <commons-cli.version>1.2</commons-cli.version>
- <commons-codec.version>1.7</commons-codec.version>
- <commons-collections.version>3.2.1</commons-collections.version>
<commons-dbcp.version>1.4</commons-dbcp.version>
- <commons-digester2.version>2.1</commons-digester2.version>
- <commons-digester3.version>3.2</commons-digester3.version>
- <commons-exec.version>1.1</commons-exec.version>
- <commons-fileupload.version>1.2.2</commons-fileupload.version>
- <commons-io.version>2.4</commons-io.version>
- <commons-lang2.version>2.6</commons-lang2.version>
<commons-lang3.version>3.1</commons-lang3.version>
- <commons-net.version>3.1</commons-net.version>
<commons-pool.version>1.6</commons-pool.version>
<ehcache.version>2.6.3</ehcache.version>
<hamcrest.version>1.3</hamcrest.version>
@@ -36,8 +25,8 @@
<jadira-usertype-core.version>3.1.0.CR1</jadira-usertype-core.version>
<javassist.version>3.17.1-GA</javassist.version>
<java.version>1.6</java.version>
- <jaxb-api.version>2.2.7</jaxb-api.version>
<javax-el.version>2.2</javax-el.version>
+ <jaxb-api.version>2.2.7</jaxb-api.version>
<jaxb-impl.version>2.2.7-b53</jaxb-impl.version>
<jboss-logging.version>3.1.2.GA</jboss-logging.version>
<jdom.version>2.0.2</jdom.version>
@@ -84,7 +73,6 @@
<webjars-jquery.version>1.9.0</webjars-jquery.version>
</properties>
-
<dependencies>
<!-- Spring -->
<dependency>
@@ -142,15 +130,13 @@
<artifactId>hsqldb</artifactId>
</dependency>
<!-- MySQL JDBC Connector -->
- <!--
+ <!-- gDickens: standard mysql library
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
-->
- <!-- Hibernate -->
- <!-- JPA -->
<!-- Hibernate JPA Provider -->
<dependency>
<groupId>org.hibernate</groupId>
@@ -160,6 +146,10 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
+ <dependency>
+ <groupId>net.sf.ehcache</groupId>
+ <artifactId>ehcache-core</artifactId>
+ </dependency>
<!-- **********************************************************************
** SPRING DATA **
********************************************************************** -->
@@ -200,6 +190,7 @@
<artifactId>jaxb-impl</artifactId>
</dependency>
<!-- Test dependencies -->
+ <!-- gDickens: Using JUnit 4.11 for cleaner Hamcrest support -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -228,23 +219,27 @@
<groupId>joda-time</groupId>
<artifactId>joda-time-hibernate</artifactId>
</dependency>
- <!-- used for Spring MVC Test framework -->
- <!-- Do not use hamcrest-all, hamcrest-library
- (hamcrest-core in dep mgmt, is used by junit) -->
+ <!-- gDickens: used for Spring MVC Test framework
+ * Do not use hamcrest-all, hamcrest-library
+ * (hamcrest-core in dep mgmt, is used by junit) -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
</dependency>
</dependencies>
- <!-- Best Practice to ALWAYS include the Maven plugin versions -->
+ <!-- gDickens: Best Practice to ALWAYS include the Maven plugin versions -->
<build>
+ <defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
+ <compilerArguments>
+ <Xlint/>
+ </compilerArguments>
<verbose>true</verbose>
<source>${java.version}</source>
<target>${java.version}</target>
@@ -269,6 +264,7 @@
<warName>petclinic</warName>
</configuration>
</plugin>
+ <!-- gDickens: Include the Builders and Natures -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
@@ -280,6 +276,19 @@
<sourceIncludes>
<sourceInclude>**/*.*</sourceInclude>
</sourceIncludes>
+ <additionalBuildcommands>
+ <buildCommand>
+ <name>org.springframework.ide.eclipse.core.springbuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ </buildCommand>
+ </additionalBuildcommands>
+ <additionalProjectnatures>
+ <projectnature>org.eclipse.jdt.core.javanature</projectnature>
+ <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
+ <projectnature>org.eclipse.m2e.core.maven2Nature</projectnature>
+ </additionalProjectnatures>
</configuration>
</plugin>
<plugin>
@@ -352,9 +361,6 @@
-->
<stopPort>9966</stopPort>
<stopKey>shutterdown</stopKey>
- <requestLog implementation="ch.qos.logback.access.jetty.RequestLogImpl">
- <fileName>./src/main/resources/logback-access.xml</fileName>
- </requestLog>
<systemProperties>
<systemProperty>
<name>logback.configurationFile</name>
@@ -403,16 +409,10 @@
<version>${logback.version}</version>
<scope>runtime</scope>
</dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-access</artifactId>
- <version>${logback.version}</version>
- <scope>runtime</scope>
- </dependency>
</dependencies>
</plugin>
<!-- *******************************************************
- For reliable builds, ensure:
+ gDickens: For reliable builds, ensure:
* NO duplicate jars of differing versions
* NO old versions of logging and Spring are included directly or Transitively
* All plugins have the version included as per Maven
@@ -463,10 +463,54 @@
</executions>
</plugin>
</plugins>
+
+ <!-- gDickens: For Eclipse's M2E plugin support -->
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <versionRange>[1.0.0,)</versionRange>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <execute/>
+ </action>
+ </pluginExecution>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <versionRange>[2.4,)</versionRange>
+ <goals>
+ <goal>unpack</goal>
+ <goal>sources</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <execute/>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
</build>
- <!-- Best Practice: Specify the transitive dependency versions, to ensure that older versions
+ <!-- gDickens: Best Practice: Specify the transitive dependency versions, to ensure that older versions
of projects are NOT included.
This is particularly important to Spring projects where projects such as Spring-Data, may
@@ -522,12 +566,6 @@
<version>${hibernate.version}</version>
</dependency>
<dependency>
- <groupId>org.jadira.usertype</groupId>
- <artifactId>usertype.core</artifactId>
- <version>${jadira-usertype-core.version}</version>
- </dependency>
-
- <dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>${ehcache.version}</version>
@@ -539,6 +577,11 @@
</exclusions>
</dependency>
<dependency>
+ <groupId>org.jadira.usertype</groupId>
+ <artifactId>usertype.core</artifactId>
+ <version>${jadira-usertype-core.version}</version>
+ </dependency>
+ <dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${validation.version}</version>
@@ -611,11 +654,6 @@
<artifactId>spring-expression</artifactId>
<version>${spring-framework.version}</version>
</dependency>
- <!--<dependency>-->
- <!--<groupId>org.springframework</groupId>-->
- <!--<artifactId>spring-instrument</artifactId>-->
- <!--<version>${spring.version}</version>-->
- <!--</dependency>-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
@@ -688,68 +726,11 @@
<version>${commons-dbcp.version}</version>
</dependency>
<dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>${commons-io.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>${commons-lang2.version}</version>
- </dependency>
- <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-exec</artifactId>
- <version>${commons-exec.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>${commons-collections.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>${commons-codec.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-net</groupId>
- <artifactId>commons-net</artifactId>
- <version>${commons-net.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>${commons-fileupload.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-digester3</artifactId>
- <version>${commons-digester3.version}</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-digester</groupId>
- <artifactId>commons-digester</artifactId>
- <version>${commons-digester2.version}</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${commons-beanutils.version}</version>
@@ -765,17 +746,7 @@
<artifactId>commons-pool</artifactId>
<version>${commons-pool.version}</version>
</dependency>
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- <version>${commons-cli.version}</version>
- <exclusions>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
+
<!-- Logging with SLF4J & LogBack -->
<dependency>
<groupId>org.slf4j</groupId>
@@ -812,16 +783,6 @@
<artifactId>rome</artifactId>
<version>${rome.version}</version>
</dependency>
- <!--<dependency>-->
- <!--<groupId>javax.activation</groupId>-->
- <!--<artifactId>activation</artifactId>-->
- <!--<version>${activation.version}</version>-->
- <!--</dependency>-->
- <!--<dependency>-->
- <!--<groupId>org.jasypt</groupId>-->
- <!--<artifactId>jasypt</artifactId>-->
- <!--<version>${jasypt.version}</version>-->
- <!--</dependency>-->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
@@ -842,12 +803,6 @@
<artifactId>antlr</artifactId>
<version>${antlr.version}</version>
</dependency>
- <dependency>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- <version>${asm.version}</version>
- </dependency>
-
<!-- Databases -->
<dependency>
@@ -930,4 +885,5 @@
</dependencies>
</dependencyManagement>
+
</project>
\ No newline at end of file
src/main/resources/logback.xml 12(+4 -8)
diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml
index 1db083f..9ccd2fc 100644
--- a/src/main/resources/logback.xml
+++ b/src/main/resources/logback.xml
@@ -14,13 +14,9 @@
</encoder>
</appender>
- <logger name="accounts" level="debug" />
- <logger name="rewards" level="debug" />
- <logger name="org.springframework.beans" level="trace" />
- <logger name="org.springframework.web.servlet" level="trace" />
- <logger name="org.springframework.core.env" level="trace" />
+ <logger name="org.springframework.samples.petclinic" level="debug"/>
- <root level="warn">
- <appender-ref ref="console" />
- </root>
+ <root level="warn">
+ <appender-ref ref="console"/>
+ </root>
</configuration>
src/main/webapp/WEB-INF/web.xml 113(+57 -56)
diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml
index 79b9bf6..ef04c4a 100644
--- a/src/main/webapp/WEB-INF/web.xml
+++ b/src/main/webapp/WEB-INF/web.xml
@@ -1,64 +1,65 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
-xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
-id="WebApp_ID" version="2.5">
+ 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_2_5.xsd"
+ id="WebApp_ID" version="2.5">
- <display-name>Spring PetClinic</display-name>
- <description>Spring PetClinic sample application</description>
-
- <context-param>
- <param-name>spring.profiles.active</param-name>
- <param-value>jdbc</param-value>
- <!-- Available profiles:
- <param-value>jdbc</param-value>
- <param-value>jpa</param-value> (in the case of plain JPA)
- <param-value>spring-data-jpa</param-value> (in the case of Spring Data JPA)
- -->
- </context-param>
+ <display-name>Spring PetClinic</display-name>
+ <description>Spring PetClinic sample application</description>
- <!--
- - Location of the XML file that defines the root application context.
- - Applied by ContextLoaderServlet.
- -->
- <context-param>
- <param-name>contextConfigLocation</param-name>
- <param-value>classpath:spring/dao-config.xml, classpath:spring/tools-config.xml</param-value>
- </context-param>
-
- <listener>
- <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
- </listener>
-
- <!--
- - Servlet that dispatches request to registered handlers (Controller implementations).
- -->
- <servlet>
- <servlet-name>petclinic</servlet-name>
- <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
- <init-param>
- <param-name>contextConfigLocation</param-name>
- <param-value>classpath:spring/mvc-core-config.xml</param-value>
- </init-param>
- <load-on-startup>1</load-on-startup>
- </servlet>
+ <context-param>
+ <param-name>spring.profiles.active</param-name>
+ <param-value>jdbc</param-value>
+ <!-- Available profiles:
+ <param-value>jdbc</param-value>
+ <param-value>jpa</param-value> (in the case of plain JPA)
+ <param-value>spring-data-jpa</param-value> (in the case of Spring Data JPA)
+ -->
+ </context-param>
- <servlet-mapping>
- <servlet-name>petclinic</servlet-name>
- <url-pattern>/</url-pattern>
- </servlet-mapping>
+ <!--
+ - Location of the XML file that defines the root application context.
+ - Applied by ContextLoaderServlet.
+ -->
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>classpath:spring/dao-config.xml, classpath:spring/tools-config.xml</param-value>
+ </context-param>
- <!-- used so we can use forms of method type 'PUT' and 'DELETE'
- see here: http://static.springsource.org/spring/docs/current/spring-framework-reference/html/view.html#rest-method-conversion
- -->
- <filter>
- <filter-name>httpMethodFilter</filter-name>
- <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
- </filter>
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+
+ <!--
+ - Servlet that dispatches request to registered handlers (Controller implementations).
+ -->
+ <servlet>
+ <servlet-name>petclinic</servlet-name>
+ <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+ <init-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>classpath:spring/mvc-core-config.xml</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>petclinic</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+
+ <!-- used so we can use forms of method type 'PUT' and 'DELETE'
+ see here: http://static.springsource.org/spring/docs/current/spring-framework-reference/html/view.html#rest-method-conversion
+ -->
+ <filter>
+ <filter-name>httpMethodFilter</filter-name>
+ <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>httpMethodFilter</filter-name>
+ <servlet-name>petclinic</servlet-name>
+ </filter-mapping>
- <filter-mapping>
- <filter-name>httpMethodFilter</filter-name>
- <servlet-name>petclinic</servlet-name>
- </filter-mapping>
-
</web-app>
\ No newline at end of file
src/test/resources/logback-test.xml 23(+23 -0)
diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml
new file mode 100644
index 0000000..682928c
--- /dev/null
+++ b/src/test/resources/logback-test.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration debug="true" scan="true" scanPeriod="30 seconds">
+
+ <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
+ <resetJUL>true</resetJUL>
+ </contextListener>
+
+ <!-- To enable JMX Management -->
+ <jmxConfigurator/>
+
+ <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%-5level %logger{0} - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <logger name="org.springframework.samples.petclinic" level="debug"/>
+ <logger name="org.springframework.test.web" level="trace"/>
+
+ <root level="warn">
+ <appender-ref ref="console"/>
+ </root>
+</configuration>