1 <Properties>2 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>3 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>4 <!--Spring Version number -5 <spring.version>4.2.4.RELEASE</spring.version>6 </Properties>7 <Dependencies>8 <!--Add Spring Core dependencies -9 <Dependency>Ten <groupId>Org.springframework</groupId> One <Artifactid>Spring-core</Artifactid> A <version>${spring.version}</version> - </Dependency> - <Dependency> the <groupId>Org.springframework</groupId> - <Artifactid>Spring-context</Artifactid> - <version>${spring.version}</version> - </Dependency> + <Dependency> - <groupId>Org.springframework</groupId> + <Artifactid>Spring-context-support</Artifactid> A <version>${spring.version}</version> at </Dependency> - <Dependency> - <groupId>Org.springframework</groupId> - <Artifactid>SPRING-AOP</Artifactid> - <version>${spring.version}</version> - </Dependency> in - <Dependency> to <groupId>Org.springframework</groupId> + <Artifactid>spring-aspects</Artifactid> - <version>${spring.version}</version> the </Dependency> * </Dependencies>
After the introduction of dependency maven dependencies is as follows:
After introducing spring-aspects dependency, the aspectjweaver-1.8.7 jar package is introduced automatically.
The following exception occur during an AOP test :
Java.lang.noclassdeffounderror:org/aspectj/weaver/reflect/reflectionworld$reflectionworldexception
Reason:
There is no dependency or aspectjweaver dependency that introduces spring-aspects. (Spring-aspects integrates with ASPECTJ, can introduce any of the one by one dependencies)
Spring----> AOP Test A exception that occurs when MAVEN dependencies/tests are required