Spring aspectj - compilation of external can weaving time

I have a project that uses compilation time aspects. this project depends on another project that is included as a bank. I want to weave a class in a jar file at compile time. How can i achieve this.

thanks

+4
source share
2 answers

This jar should be added to the inpath of the compiled project. The result will be a new set of class files. These new class files are woven and should be used at run time instead of the original jar.

How to set the input path depends on how you compile your code:

The hard part is not to forget to use the original cans in the running application, but rather woven cans.

+4
source

If you are using maven, you can also use the aspectj-maven plugin. It works well with eclipse (m2e).

In the plugin, simply specify the groupId / artifactId of the dependent jar, as well as in the / weaveDependencies / weaveDepedency configuration.

See http://mojo.codehaus.org/aspectj-maven-plugin/weaveJars.html

+4
source

Source: https://habr.com/ru/post/1337804/


All Articles