[英]IntelliJ ApectJ post-compile time weaving
I have the following aspect:我有以下几个方面:
@Aspect
public class DefaultStringAspect {
@Around(value = "execution(* org.apache.commons.lang3.StringUtils.defaultString(..))")
public Object defaultString(ProceedingJoinPoint pjp) {
return "DEF";
}
}
This aspect is applied to a classpath library.这方面应用于类路径库。 It works fine with maven configuration below:它适用于以下 Maven 配置:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
..
<configuration>
..
<weaveDependencies>
<weaveDependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</weaveDependency>
</weaveDependencies>
</configuration>
</plugin>
When I try to build the project from IntelliJ IDEA, the aspect is not applied.当我尝试从 IntelliJ IDEA 构建项目时,未应用该方面。 The aspect itself is compiled, but woven dependencies are not.方面本身已编译,但编织依赖项未编译。 I've tried to adjust ajc
command line options taken from maven's debug output and add them to IntelliJ:我试图调整从 maven 的调试输出中获取的ajc
命令行选项并将它们添加到 IntelliJ:
-showWeaveInfo -verbose -classpath ... -inpath ... -d ... -showWeaveInfo -verbose -classpath ... -inpath ... -d ...
but this didn't work for me.但这对我不起作用。 Any other ideas how to force IntelliJ to use the same ajc
configuration as maven?任何其他想法如何强制 IntelliJ 使用与 maven 相同的ajc
配置?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.