Skip to content
Snippets Groups Projects
Commit 46260018 authored by Gordon Dickens's avatar Gordon Dickens
Browse files

switched to modern logback for logging, see logback.xml and logback-test.xml for configuration

parent cf9a540e
No related branches found
No related tags found
No related merge requests found
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<maven-help-plugin.version>2.1.1</maven-help-plugin.version> <maven-help-plugin.version>2.1.1</maven-help-plugin.version>
<maven-install-plugin.version>2.4</maven-install-plugin.version> <maven-install-plugin.version>2.4</maven-install-plugin.version>
<maven-jar-plugin.version>2.4</maven-jar-plugin.version> <maven-jar-plugin.version>2.4</maven-jar-plugin.version>
<maven-javadoc-plugin.version>2.9</maven-javadoc-plugin.version>
<maven-jetty-plugin.version>8.1.9.v20130131</maven-jetty-plugin.version> <maven-jetty-plugin.version>8.1.9.v20130131</maven-jetty-plugin.version>
<maven-m2e-lifecycle-plugin.version>1.0.0</maven-m2e-lifecycle-plugin.version> <maven-m2e-lifecycle-plugin.version>1.0.0</maven-m2e-lifecycle-plugin.version>
<maven-plugin-plugin.version>3.2</maven-plugin-plugin.version> <maven-plugin-plugin.version>3.2</maven-plugin-plugin.version>
...@@ -62,6 +63,9 @@ ...@@ -62,6 +63,9 @@
<maven.version.range>[2.2.1,3.1.0)</maven.version.range> <maven.version.range>[2.2.1,3.1.0)</maven.version.range>
<maven-war-plugin.version>2.3</maven-war-plugin.version> <maven-war-plugin.version>2.3</maven-war-plugin.version>
<mysql.version>5.1.22</mysql.version> <mysql.version>5.1.22</mysql.version>
<!-- gDickens: Best Practice: ALWAYS define source encoding for platform independence -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<rome.version>1.0</rome.version> <rome.version>1.0</rome.version>
<servlet.version>2.5</servlet.version> <servlet.version>2.5</servlet.version>
<slf4j.version>1.7.2</slf4j.version> <slf4j.version>1.7.2</slf4j.version>
...@@ -462,6 +466,59 @@ ...@@ -462,6 +466,59 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${maven-site-plugin.version}</version>
<executions>
<execution>
<id>attach-descriptor</id>
<goals>
<goal>attach-descriptor</goal>
</goals>
</execution>
</executions>
<configuration>
<reportPlugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<outputDirectory>${project.reporting.outputDirectory}/testresults</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<aggregate>true</aggregate>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>${maven-project-info-reports-plugin.version}</version>
<configuration>
<dependencyDetailsEnabled>false</dependencyDetailsEnabled>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
</configuration>
</plugin>
</reportPlugins>
<locales>en</locales>
</configuration>
</plugin>
</plugins> </plugins>
<!-- gDickens: For Eclipse's M2E plugin support --> <!-- gDickens: For Eclipse's M2E plugin support -->
...@@ -885,5 +942,5 @@ ...@@ -885,5 +942,5 @@
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
</project> </project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true" scan="true" scanPeriod="30 seconds"> <configuration scan="true" scanPeriod="30 seconds">
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"> <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL> <resetJUL>true</resetJUL>
......
...@@ -3,99 +3,100 @@ ...@@ -3,99 +3,100 @@
Application context definition for PetClinic on JPA. Application context definition for PetClinic on JPA.
--> -->
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- ========================= RESOURCE DEFINITIONS ========================= --> <!-- ========================= RESOURCE DEFINITIONS ========================= -->
<!-- import the dataSource definition --> <!-- import the dataSource definition -->
<import resource="datasource-config.xml"/> <import resource="datasource-config.xml"/>
<!-- Configurer that replaces ${...} placeholders with values from a properties file --> <!-- Configurer that replaces ${...} placeholders with values from a properties file -->
<!-- (in this case, JDBC-related settings for the JPA EntityManager definition below) --> <!-- (in this case, JDBC-related settings for the JPA EntityManager definition below) -->
<context:property-placeholder location="classpath:spring/jdbc.properties"/> <context:property-placeholder location="classpath:spring/jdbc.properties"/>
<!-- ========================= BUSINESS OBJECT DEFINITIONS ========================= --> <!-- ========================= BUSINESS OBJECT DEFINITIONS ========================= -->
<!-- <!--
Activates various annotations to be detected in bean classes: Spring's Activates various annotations to be detected in bean classes: Spring's
@Required and @Autowired, as well as JSR 250's @PostConstruct, @Required and @Autowired, as well as JSR 250's @PostConstruct,
@PreDestroy and @Resource (if available) and JPA's @PersistenceContext @PreDestroy and @Resource (if available) and JPA's @PersistenceContext
and @PersistenceUnit (if available). and @PersistenceUnit (if available).
--> -->
<context:annotation-config/> <context:annotation-config/>
<!-- <!--
Instruct Spring to perform declarative transaction management Instruct Spring to perform declarative transaction management
automatically on annotated classes. automatically on annotated classes.
for mode="aspectj"/ see SPR-6392 for mode="aspectj"/ see SPR-6392
--> -->
<tx:annotation-driven/> <tx:annotation-driven/>
<beans profile="jpa,spring-data-jpa"> <beans profile="jpa,spring-data-jpa">
<!-- JPA EntityManagerFactory --> <!-- JPA EntityManagerFactory -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
p:dataSource-ref="dataSource"> p:dataSource-ref="dataSource">
<property name="jpaVendorAdapter"> <property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
p:database="${jpa.database}" p:showSql="${jpa.showSql}" /> p:database="${jpa.database}" p:showSql="${jpa.showSql}"/>
</property> </property>
<property name="persistenceUnitName" value="petclinic" /> <property name="persistenceUnitName" value="petclinic"/>
<property name="packagesToScan" value="org/springframework/samples/petclinic" /> <property name="packagesToScan" value="org/springframework/samples/petclinic"/>
</bean> </bean>
<!-- Transaction manager for a single JPA EntityManagerFactory (alternative to JTA) --> <!-- Transaction manager for a single JPA EntityManagerFactory (alternative to JTA) -->
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
p:entityManagerFactory-ref="entityManagerFactory"/> p:entityManagerFactory-ref="entityManagerFactory"/>
<!--
<!-- Post-processor to perform exception translation on @Repository classes (from native
Post-processor to perform exception translation on @Repository classes (from native exceptions such as JPA PersistenceExceptions to Spring's DataAccessException hierarchy).
exceptions such as JPA PersistenceExceptions to Spring's DataAccessException hierarchy). -->
--> <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
</beans>
</beans>
<beans profile="jdbc">
<beans profile="jdbc"> <!-- Transaction manager for a single JDBC DataSource (alternative to JTA) -->
<!-- Transaction manager for a single JDBC DataSource (alternative to JTA) --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager" p:dataSource-ref="dataSource"/>
p:dataSource-ref="dataSource"/>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"> <constructor-arg ref="dataSource"/>
<constructor-arg ref="dataSource" /> </bean>
</bean>
<bean id="namedParameterJdbcTemplate"
<bean id="namedParameterJdbcTemplate" class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate"> class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate">
<constructor-arg ref="dataSource" /> <constructor-arg ref="dataSource"/>
</bean> </bean>
<context:component-scan base-package="org.springframework.samples.petclinic.repository.jdbc"/> <context:component-scan base-package="org.springframework.samples.petclinic.repository.jdbc"/>
</beans> </beans>
<beans profile="jpa"> <beans profile="jpa">
<!-- <!--
Will automatically be transactional due to @Transactional. Will automatically be transactional due to @Transactional.
EntityManager will be auto-injected due to @PersistenceContext. EntityManager will be auto-injected due to @PersistenceContext.
PersistenceExceptions will be auto-translated due to @Repository. PersistenceExceptions will be auto-translated due to @Repository.
--> -->
<context:component-scan base-package="org.springframework.samples.petclinic.repository.jpa"/> <context:component-scan base-package="org.springframework.samples.petclinic.repository.jpa"/>
</beans> </beans>
<beans profile="spring-data-jpa"> <beans profile="spring-data-jpa">
<jpa:repositories base-package="org.springframework.samples.petclinic.repository.springdatajpa"/> <jpa:repositories base-package="org.springframework.samples.petclinic.repository.springdatajpa"/>
<!-- Custom configuration for the custom implementation based on JPA --> <!-- Custom configuration for the custom implementation based on JPA -->
<bean id="owerRepository" class="org.springframework.samples.petclinic.repository.springdatajpa.JpaOwnerRepositoryImpl"/> <bean id="owerRepository"
class="org.springframework.samples.petclinic.repository.springdatajpa.JpaOwnerRepositoryImpl"/>
</beans>
</beans>
</beans> </beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true" scan="true" scanPeriod="30 seconds"> <configuration debug="true">
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"> <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL> <resetJUL>true</resetJUL>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment