In a Maven project A, there are a couple of Junit tests for some Java components.
My goal is to apply an aspect (using AspectJ) to the component classes and then execute the Junit tests. The aspect will do some counting of the component method calls.
I'm aware of the different methods to weave the code (compile, post-compile, load-time). I'm also aware of the aspectj-maven-plugin that i'd like to use.
The challenge I'm facing is that I don't want to touch any code of project A, like changing the pom.xml or adding the aspect. Also, i want to run the Junit tests of project A using Maven targets.
So my question is how to set up/configure another Maven project B that
- contains my aspect
- weaves the component classes of project A
- mabe repackages the woven classes
- executes the Junit tests of project A with the woven classes
Has anyone done anything similar and can point me in the right direction?