<build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId> <version>1.12.6</version> <configuration> <complianceLevel>1.8</complianceLevel> <source>1.8</source> <target>1.8</target> <verbose>true</verbose> </configuration> <executions> <execution> <goals> <goal>compile</goal> <goal>test-compile</goal> </goals> </execution> </executions> </plugin> </plugins> </build> aspect LoggingAspect { pointcut loggableMethods() : execution(* com.example.*.*(..)); before() : loggableMethods() { System.out.println("Before method execution"); } } mvn compile


上一篇:
下一篇:
切换中文