Pay attention: for the dependency to work you also need to add the following snippets to your pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<useModulePath>false</useModulePath>
<argLine>
${argLine}
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/1.9.24/aspectjweaver-1.9.24.jar"
-Daj.weaving.verbose=false
</argLine>
</configuration>
</plugin>
1.9.24 above is
an example. In the -javaagent parameter you must specify the
actual version of aspectjweaver that you added as a
dependency. Make sure to update it accordingly in your project.
<properties>
<!-- so that ${argLine} won't remain a literal -->
<argLine/>
</properties>