1

Below are the warnings I receive :

Description Resource    Path    Location    Type
advice defined in org.springframework.mock.staticmock.AbstractMethodMockingControl has not been applied [Xlint:adviceDidNotMatch]

Location    Type
advice defined in org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl has not been applied [Xlint:adviceDidNotMatch]

Location    Type
advice defined in org.springframework.orm.jpa.aspectj.JpaExceptionTranslatorAspect has not been applied [Xlint:adviceDidNotMatch]

Location    Type
advice defined in org.springframework.scheduling.aspectj.AbstractAsyncExecutionAspect has not been applied [Xlint:adviceDidNotMatch]

I am not able to find a solution to get ride of these warnings. My current project pom file contains the below version :

JDK version = 1.7
roo version = 1.3.1.RELEASE
spring version=3.2.18.RELEASE
aspectj version = 1.8.1
aspectj-maven-plugin version = 1.4

Solution 1 Tried : I have tried updating the JDK version=1.8 and roo version = 2.0.0.RELEASE , but still came up with the same warning.

Solution 2 Tried: I added <Xlint>adviceDidNotMatch=error,noGuardForLazyTjp=ignore</Xlint> tag inside <configuration tag> with respect to aspectj-maven-plugin. This didnt work either.

Any suggestions on other approaches to remove these Warnings.

kriegaex
  • 63,017
  • 15
  • 111
  • 202

1 Answers1

0

As you only show a couple of warnings (not errors, so relax!) and not MCVE, i.e. application + aspect code + POM + any other configuration, I can only speculate about your actual situation, but maybe the Maven module in question is an aspect library to be used in other modules or applications via load-time weaving or compile-time weaving. Anyway, in this case the warnings would be normal because a pointcut cannot match if there is no matching target code while compiling the aspect. So there have to be informational warnings like that, I would not suppress them if I were you.

The alternative case is that in your module there are aspect and application code together and you actually expect each aspect to match. In that case the warning tells you that probably your pointcuts do not match because they are wrong in one way or another. Then you simply have to fix them.

This is the general answer to your very generic question. If you would please update your question (by editing it) and notify me, adding the MCVE I mentioned above (please follow the link in order to find out what I mean), I can also edit this answer and make it more precise. Tit for tat - if give me more information, I can pay back in the same currency.


Edit: On a second thought, I am wondering why you use the AspectJ compiler at all because you seem to be working with Spring. The most common scenario for Spring is to use Spring AOP (which does not need any AspectJ compiler because it is proxy-based). Of course you can also use full AspectJ from within Spring, then what I said above applies again. But for that I really need more information.

kriegaex
  • 63,017
  • 15
  • 111
  • 202