I am trying to reproduce the example in Using AspectJ annotations in maven project: weaving is not working with the answer given there. In articular, now I am using Eclipse Photon, JDK 1.8 but with no success.
My Final POM.XML is:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com</groupId> <artifactId>aspect-tutorial</artifactId> <version>0.0.1-SNAPSHOT</version> <properties> <maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version> </properties> <dependencies> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>1.9.5</version> </dependency> </dependencies> <build> <pluginManagement> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId> <version>1.11</version> <configuration> <complianceLevel>1.8</complianceLevel> <source>1.8</source> <target>1.8</target> </configuration> <executions> <execution> <!-- IMPORTANT --> <phase>process-sources</phase> <goals> <goal>compile</goal> <goal>test-compile</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>${maven.compiler.plugin.version}</version> <configuration> <source>1.8</source> <target>1.8</target> <!-- IMPORTANT --> <useIncrementalCompilation>false</useIncrementalCompilation> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.6.0</version> <configuration> <mainClass>com.pkg.MainApp</mainClass> </configuration> </plugin> </plugins> </pluginManagement> </build></project> I have tried to run both with Eclipse (MainApp --> Run as...) and with Maven (pom.xml -->Run as --> Maven Build), but no weaving is taken place. Any idea?
Thanks a lot! Bea