[英]AspectJ: Injecting aspects to project as a third party library
There are 2 projects: 有2个项目:
main
method with the output of the message " It's A project" ); main
方法包含一个简单的类,并输出消息“ It's A project” ); Projects A and B are based on the Spring Framework . 项目A和B基于Spring框架 。 Project B contains aspects that used the
percflow
model, which is currently not supported by Spring. 项目B包含使用
percflow
模型的方面,Spring 目前不支持该模型。
Can I compile aspects using the AspectJ compiler without using the project A (hence without compile-time
/ post-compile
weaving) and then, on the basis of project B build a jar file that I can add to A project dependencies for further usage? 是否可以在不使用项目A的情况下使用AspectJ编译器来编译方面(因此无需进行
compile-time
/ post-compile
编织),然后在项目B的基础上构建一个jar文件,可以将其添加到A项目依赖项中以供进一步使用?
That is at a stage of assembly of the jar-file the project B knows nothing of the project A . 那就是在jar文件的汇编阶段,项目B对项目A一无所知。
It will probably be necessary to use load-time
weaving. 可能有必要使用
load-time
编织。 How exactly should Spring be configured to automatically pick up aspects from the B project's jar file when it is added to project A ? 当将Spring项目添加到项目A中时,如何正确配置Spring自动从B项目的jar文件中拾取方面?
Thank you. 谢谢。
What you want is possible: 您想要的是可能的:
Sorry for not answering in more detail, but your question is also quite theoretical, you neither show any code or build information nor do you share a link to a sample project on GitHub. 抱歉,我没有回答更多细节,但是您的问题也是理论上的,您既不显示任何代码也不构建信息,也不共享GitHub上示例项目的链接。 Creating an MCVE would help the community to write better answers.
创建MCVE将有助于社区写出更好的答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.