I am using Spring AOP. I want my target method be matched only when invoked from a certain package. For example, let's assume my target method is com.domain.target.MyService.run(), and that it can be accessed from anywhere in my project. However, I want the pointcut to trigger only when the method is invoked from within a certain package, say com.domain.caller.*.
Is this something doable?
Yes, it's able to advice with package.
We could also match any type within the package or a sub-package.
You can find more detail:
https://www.baeldung.com/spring-aop-pointcut-tutorial