简体   繁体   English

Aspectj Maven插件错误

[英]Aspectj maven plugin error

I got this error 我得到这个错误

[ERROR] can't determine superclass of missing type org.springframework.aop.interceptor.AsyncExecutionAspectSupport
when batch building BuildConfig[null] #Files=18 AopXmls=#0
 [Xlint:cantFindType]

This is my part of POM with aspectj plugin aspectj.version is 1.6.11 这是我使用Aspectj插件AspectJ.version是1.6.11的POM的一部分

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>aspectj-maven-plugin</artifactId>
            <version>1.4</version>

            <configuration>
                <showWeaveInfo>false</showWeaveInfo>
                <verbose>false</verbose>
                <source>1.7</source>
                <target>1.7</target>
                <complianceLevel>1.7</complianceLevel>

                <aspectLibraries>
                    <aspectLibrary>
                        <groupId>ru.sofitlabs</groupId>
                        <artifactId>ngutil</artifactId>
                    </aspectLibrary>

                    <aspectLibrary>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-aspects</artifactId>
                    </aspectLibrary>
                </aspectLibraries>
            </configuration>

            <executions>
                <execution>
                    <goals>
                        <goal>compile</goal>
                        <goal>test-compile</goal>
                    </goals>
                </execution>
            </executions>

            <dependencies>
                <dependency>
                    <groupId>org.aspectj</groupId>
                    <artifactId>aspectjrt</artifactId>
                    <version>${aspectj.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.aspectj</groupId>
                    <artifactId>aspectjweaver</artifactId>
                    <version>${aspectj.version}</version>
                </dependency>
            </dependencies>
        </plugin>

I will appreciate any help. 我将不胜感激。

The missing type org.springframework.aop.interceptor.AsyncExecutionAspectSupport is supposed to be in spring-aop which depends spring-aspects. 缺少的类型org.springframework.aop.interceptor.AsyncExecutionAspectSupport应该在spring-aop中,这取决于spring-aspects。

Are you sure the jar spring-aop is in your classpath at exec time ? 您确定jar的spring-aop在执行时位于您的类路径中吗?

Finally found a solution. 终于找到了解决方案。 I set compilance, source and target level to 1.7 ( do not forget to set parameters "-XX:-UseSplitVerifier" for server VM ) and excluded lots of dependencies. 我将编译级别,源级别和目标级别设置为1.7( 不要忘记为服务器VM设置参数“ -XX:-UseSplitVerifier” ), 并排除了很多依赖项。 For example old springaspects, spring-aop and so on. 例如,旧的springaspects,spring-aop等。 IDEA has a nice tool - dependencies graph, which is very useful in this case. IDEA有一个很好的工具-依赖关系图,在这种情况下非常有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM