yegor256
yegor256

Reputation: 105053

aspectj-maven-plugin multi module project

I'm trying to use aspectj-maven-plugin in a multi-module project and can't understand where aspects have to be placed. I want to crosscut in-module and between-modules calls. Where .aj files should be located?

Upvotes: 3

Views: 1551

Answers (1)

yegor256
yegor256

Reputation: 105053

This is what I did so far (structure of maven modules):

foo
  foo-api
  foo-impl
  foo-aspects

.aj files are located in src/main/aspect. All sub-modules (except foo-aspects) are using aspectLibraries option of aspectj-maven-plugin, where they use aspects from foo-aspects.jar.

At the same time every sub-module has its own aspects in src/main/aspect. Works fine for me so far.

Upvotes: 2

Related Questions