Annotating interfaces or interface methods with @Cache* annotations is not recommended by the official Spring documentation. If you
use the weaving-based aspect (mode="aspectj"), the @Cache* annotations will be ignored, and no caching proxy will be created.
This rule raises an issue when an interface or an interface method is annotated with a @Cache* annotation.
Move @Cache* annotation from interface or interface method to the concrete class.
public interface ExampleService {
@Cacheable("exampleCache") //non compliant, interface method is annotated with @Cacheable
String getData(String id);
}
@Service
public class ExampleServiceImpl implements ExampleService {
@Cacheable("exampleCache")
@Override
public String getData(String id) {
// Implementation here
}
}