IntelliJ IDEA “Cannot resolve method” on aspect-defined method

流过昼夜 提交于 2019-12-12 02:39:58

问题


I am using spring-data-neo4j 3.4.2, which is (optionally) using AspectJ.

My IDE is IntelliJ IDEA 16 (EAP, IU-144.3891.8). I have had the same problem using latest IntelliJ IDEA 15.

Everything works fine so far within IntelliJ, I can compile, run my Unit-Tests, deploy and run my web-application to/on Wildfly and so on.

When building my project in IntelliJ, I can see usage of the required aspects (the following warning is ok).

org.springframework.data.neo4j.aspects.support.node.Neo4jNodeBacking has not been applied [Xlint:adviceDidNotMatch]
...

My problem: IntelliJ IDEA uses the spring-aspects/ajc correctly. But in the editor, the aspects are not resolved/used. Code-completion etc. does not work.

At AspectJ-facet configuration, aspect-path is configured as suggested.

.

Plugins "AspectJ Support" and "Spring AOP/@AspectJ" are installed and active.

I would like to use the spring-(data-)aspects in my editor, any suggestions, how IntelliJ Editor can get aware of the apsects?


回答1:


There are a lot of open AspectJ-related tickets for IDEA. They have not been resolved for a long time. I love IDEA, but when it comes to AspectJ support Eclipse is superior, probably because AspectJ is an Eclipse project. So whenever I am dealing with AspectJ, I normally use Eclipse, as much as I would like to do everything in my favourite IDE IntelliJ IDEA.



来源:https://stackoverflow.com/questions/35479646/intellij-idea-cannot-resolve-method-on-aspect-defined-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!