On because the weaver option ‘- x set:weaveJavaxPackages=true ‘has not been specified’

I’m AspectJ in proxy mode

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.10</version>
    <configuration>
        <argLine>
            -javaagent:/Users/hongjie/.m2/repository/org/aspectj/aspectjweaver/1.8.13/aspectjweaver-1.8.13.jar
        </argLine>
        <useSystemClassLoader>true</useSystemClassLoader>
        <forkMode>always</forkMode>
    </configuration>
</plugin>

The code error is as follows:

Solution:

1. You need to configure the aop.xml file in resources and place it in the meta-inf directory (resource/meta-inf/AOP. XML). If you don’t create it by yourself

2. The configuration in aop.xml file is very easy to understand. You only need to configure aspects and the classes to be woven

aop.xml

<?xml version="1.0" encoding="UTF-8" ?>
<aspectj>
    <weaver options="-Xset:weaveJavaxPackages=true -Xlint:ignore -verbose">
    </weaver>
</aspectj>

Run again to solve the problem, no error will be reported

Similar Posts: