# spring_aop_2 **Repository Path**: MarkPolaris/spring-exercise2 ## Basic Information - **Project Name**: spring_aop_2 - **Description**: Spring-aop注释实现 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2019-07-26 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ##### Spring实现五大通知(注解方式) 测试 > 配置maven依赖 ```xml 4.0.0 com.neuedu spring-exercise2 1.0-SNAPSHOT spring-exercise2 http://www.example.com UTF-8 1.8 1.8 5.1.5.RELEASE junit junit 4.12 org.projectlombok lombok 1.18.4 org.springframework spring-core ${spring.version} org.springframework spring-context ${spring.version} org.springframework spring-expression ${spring.version} org.springframework spring-beans ${spring.version} org.springframework spring-test ${spring.version} test org.springframework spring-jdbc 5.1.5.RELEASE org.mybatis mybatis-spring 2.0.1 org.mybatis mybatis 3.4.6 mysql mysql-connector-java 5.1.46 com.alibaba druid 1.1.10 log4j log4j 1.2.17 org.slf4j slf4j-log4j12 1.7.25 org.apache.commons commons-lang3 3.8.1 cglib cglib 3.2.12 org.aspectj aspectjweaver 1.9.4 maven-clean-plugin 3.1.0 maven-resources-plugin 3.0.2 maven-compiler-plugin 3.8.0 maven-surefire-plugin 2.22.1 maven-jar-plugin 3.0.2 maven-install-plugin 2.5.2 maven-deploy-plugin 2.8.2 maven-site-plugin 3.7.1 maven-project-info-reports-plugin 3.0.0 ``` > 1. 先写业务类,加载到容器 > 2. 写aop类,加载到容器 > 3. 一定要注意新建项目测试时添加注解到测试类 ```java //使用junit4进行测试 @RunWith(SpringJUnit4ClassRunner.class) //加载配置文件 @ContextConfiguration(locations={"classpath:spring-config.xml"}) ```