mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 12:15:50 +00:00
switched to modern logback for logging, see logback.xml and logback-test.xml for configuration
This commit is contained in:
parent
cf9a540e94
commit
46260018d1
4 changed files with 143 additions and 85 deletions
59
pom.xml
59
pom.xml
|
@ -49,6 +49,7 @@
|
|||
<maven-help-plugin.version>2.1.1</maven-help-plugin.version>
|
||||
<maven-install-plugin.version>2.4</maven-install-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-m2e-lifecycle-plugin.version>1.0.0</maven-m2e-lifecycle-plugin.version>
|
||||
<maven-plugin-plugin.version>3.2</maven-plugin-plugin.version>
|
||||
|
@ -62,6 +63,9 @@
|
|||
<maven.version.range>[2.2.1,3.1.0)</maven.version.range>
|
||||
<maven-war-plugin.version>2.3</maven-war-plugin.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>
|
||||
<servlet.version>2.5</servlet.version>
|
||||
<slf4j.version>1.7.2</slf4j.version>
|
||||
|
@ -462,6 +466,59 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</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>
|
||||
|
||||
<!-- gDickens: For Eclipse's M2E plugin support -->
|
||||
|
@ -885,5 +942,5 @@
|
|||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
|
||||
</project>
|
|
@ -1,5 +1,5 @@
|
|||
<?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">
|
||||
<resetJUL>true</resetJUL>
|
||||
|
|
|
@ -3,99 +3,100 @@
|
|||
Application context definition for PetClinic on JPA.
|
||||
-->
|
||||
<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: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
|
||||
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"
|
||||
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/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">
|
||||
|
||||
<!-- ========================= RESOURCE DEFINITIONS ========================= -->
|
||||
<!-- ========================= RESOURCE DEFINITIONS ========================= -->
|
||||
|
||||
<!-- import the dataSource definition -->
|
||||
<import resource="datasource-config.xml"/>
|
||||
<!-- import the dataSource definition -->
|
||||
<import resource="datasource-config.xml"/>
|
||||
|
||||
|
||||
<!-- Configurer that replaces ${...} placeholders with values from a properties file -->
|
||||
<!-- (in this case, JDBC-related settings for the JPA EntityManager definition below) -->
|
||||
<context:property-placeholder location="classpath:spring/jdbc.properties"/>
|
||||
<!-- Configurer that replaces ${...} placeholders with values from a properties file -->
|
||||
<!-- (in this case, JDBC-related settings for the JPA EntityManager definition below) -->
|
||||
<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
|
||||
@Required and @Autowired, as well as JSR 250's @PostConstruct,
|
||||
@PreDestroy and @Resource (if available) and JPA's @PersistenceContext
|
||||
and @PersistenceUnit (if available).
|
||||
-->
|
||||
<context:annotation-config/>
|
||||
<!--
|
||||
Activates various annotations to be detected in bean classes: Spring's
|
||||
@Required and @Autowired, as well as JSR 250's @PostConstruct,
|
||||
@PreDestroy and @Resource (if available) and JPA's @PersistenceContext
|
||||
and @PersistenceUnit (if available).
|
||||
-->
|
||||
<context:annotation-config/>
|
||||
|
||||
<!--
|
||||
Instruct Spring to perform declarative transaction management
|
||||
automatically on annotated classes.
|
||||
|
||||
for mode="aspectj"/ see SPR-6392
|
||||
-->
|
||||
<tx:annotation-driven/>
|
||||
<!--
|
||||
Instruct Spring to perform declarative transaction management
|
||||
automatically on annotated classes.
|
||||
|
||||
for mode="aspectj"/ see SPR-6392
|
||||
-->
|
||||
<tx:annotation-driven/>
|
||||
|
||||
<beans profile="jpa,spring-data-jpa">
|
||||
<!-- JPA EntityManagerFactory -->
|
||||
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
|
||||
p:dataSource-ref="dataSource">
|
||||
<property name="jpaVendorAdapter">
|
||||
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
|
||||
p:database="${jpa.database}" p:showSql="${jpa.showSql}" />
|
||||
</property>
|
||||
<property name="persistenceUnitName" value="petclinic" />
|
||||
<property name="packagesToScan" value="org/springframework/samples/petclinic" />
|
||||
</bean>
|
||||
|
||||
<!-- Transaction manager for a single JPA EntityManagerFactory (alternative to JTA) -->
|
||||
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
|
||||
p:entityManagerFactory-ref="entityManagerFactory"/>
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
Post-processor to perform exception translation on @Repository classes (from native
|
||||
exceptions such as JPA PersistenceExceptions to Spring's DataAccessException hierarchy).
|
||||
-->
|
||||
<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
|
||||
|
||||
</beans>
|
||||
|
||||
<beans profile="jdbc">
|
||||
<!-- Transaction manager for a single JDBC DataSource (alternative to JTA) -->
|
||||
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"
|
||||
p:dataSource-ref="dataSource"/>
|
||||
<beans profile="jpa,spring-data-jpa">
|
||||
<!-- JPA EntityManagerFactory -->
|
||||
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
|
||||
p:dataSource-ref="dataSource">
|
||||
<property name="jpaVendorAdapter">
|
||||
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
|
||||
p:database="${jpa.database}" p:showSql="${jpa.showSql}"/>
|
||||
</property>
|
||||
<property name="persistenceUnitName" value="petclinic"/>
|
||||
<property name="packagesToScan" value="org/springframework/samples/petclinic"/>
|
||||
</bean>
|
||||
|
||||
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
|
||||
<constructor-arg ref="dataSource" />
|
||||
</bean>
|
||||
|
||||
<bean id="namedParameterJdbcTemplate" class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate">
|
||||
<constructor-arg ref="dataSource" />
|
||||
</bean>
|
||||
|
||||
<context:component-scan base-package="org.springframework.samples.petclinic.repository.jdbc"/>
|
||||
|
||||
</beans>
|
||||
|
||||
<beans profile="jpa">
|
||||
<!--
|
||||
Will automatically be transactional due to @Transactional.
|
||||
EntityManager will be auto-injected due to @PersistenceContext.
|
||||
PersistenceExceptions will be auto-translated due to @Repository.
|
||||
-->
|
||||
<context:component-scan base-package="org.springframework.samples.petclinic.repository.jpa"/>
|
||||
<!-- Transaction manager for a single JPA EntityManagerFactory (alternative to JTA) -->
|
||||
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
|
||||
p:entityManagerFactory-ref="entityManagerFactory"/>
|
||||
|
||||
</beans>
|
||||
|
||||
<beans profile="spring-data-jpa">
|
||||
<jpa:repositories base-package="org.springframework.samples.petclinic.repository.springdatajpa"/>
|
||||
|
||||
<!-- Custom configuration for the custom implementation based on JPA -->
|
||||
<bean id="owerRepository" class="org.springframework.samples.petclinic.repository.springdatajpa.JpaOwnerRepositoryImpl"/>
|
||||
|
||||
</beans>
|
||||
|
||||
<!--
|
||||
Post-processor to perform exception translation on @Repository classes (from native
|
||||
exceptions such as JPA PersistenceExceptions to Spring's DataAccessException hierarchy).
|
||||
-->
|
||||
<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
|
||||
|
||||
</beans>
|
||||
|
||||
<beans profile="jdbc">
|
||||
<!-- Transaction manager for a single JDBC DataSource (alternative to JTA) -->
|
||||
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"
|
||||
p:dataSource-ref="dataSource"/>
|
||||
|
||||
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
|
||||
<constructor-arg ref="dataSource"/>
|
||||
</bean>
|
||||
|
||||
<bean id="namedParameterJdbcTemplate"
|
||||
class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate">
|
||||
<constructor-arg ref="dataSource"/>
|
||||
</bean>
|
||||
|
||||
<context:component-scan base-package="org.springframework.samples.petclinic.repository.jdbc"/>
|
||||
|
||||
</beans>
|
||||
|
||||
<beans profile="jpa">
|
||||
<!--
|
||||
Will automatically be transactional due to @Transactional.
|
||||
EntityManager will be auto-injected due to @PersistenceContext.
|
||||
PersistenceExceptions will be auto-translated due to @Repository.
|
||||
-->
|
||||
<context:component-scan base-package="org.springframework.samples.petclinic.repository.jpa"/>
|
||||
|
||||
</beans>
|
||||
|
||||
<beans profile="spring-data-jpa">
|
||||
<jpa:repositories base-package="org.springframework.samples.petclinic.repository.springdatajpa"/>
|
||||
|
||||
<!-- Custom configuration for the custom implementation based on JPA -->
|
||||
<bean id="owerRepository"
|
||||
class="org.springframework.samples.petclinic.repository.springdatajpa.JpaOwnerRepositoryImpl"/>
|
||||
|
||||
</beans>
|
||||
</beans>
|
|
@ -1,5 +1,5 @@
|
|||
<?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">
|
||||
<resetJUL>true</resetJUL>
|
||||
|
|
Loading…
Reference in a new issue