Eclipse 中的 Maven/AJDT 项目
我需要在maven项目中使用aspectj。我安装了 Eclipse (m2e) 的 Maven 插件、Maven AspectJ 插件以及 Eclipse 的 AJDT。所以现在,当我打开一个新项目时,我有“Maven Project”和“AspectJ Project”。我怎样才能创建一个新项目 Maven AspectJ 项目? 我没有找到任何参考资料,所以你是我唯一的希望。 谢谢
I need to use aspectj in a maven project. I installed the maven plugin for eclipse (m2e), the maven aspectj plugin, and also AJDT for Eclipse. So now, when i open a new project i have "Maven Project" and "AspectJ Project". how can i make a new project that is Maven AspectJ project?
I did not found any reference for that, so you are my only hope.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
源:http://blog.springsource.com/2011/10/18/upgrading-maven-integration-for-springsource-tool-suite-2-8-0/#comment-207264 (安德鲁·艾森伯格)
Source: http://blog.springsource.com/2011/10/18/upgrading-maven-integration-for-springsource-tool-suite-2-8-0/#comment-207264 (Andrew Eisenberg)
您应该将 maven-aspectj-plugin 添加到 pom.xml 中的构建插件部分,如下所示:
You should add the maven-aspectj-plugin to your build plugins section in your pom.xml as in:
检查 m2eclipse 的 AJDT 项目配置器
m2eclipse-AJDT 插件检测到
pom.xml
包含aspectj-maven-plugin
并自动添加相关的AJDT
在 Eclipse 中导入项目时的性质和配置。我认为已经为该插件与 m2eclipse 0.12 版本一起工作做了一些努力,不知道它是否有效。
我已经使用 m2eclipse 0.10 尝试过该插件,效果很好。
请参阅 GitHub m2eclipse-ajdt 项目
请参阅将 AJDT 集成移出主 m2e 源代码树
Check AJDT project configurator for m2eclipse
The m2eclipse-AJDT plugin detect that the
pom.xml
contains theaspectj-maven-plugin
and add automatically the relevantAJDT
nature and configuration to the project when importing it in eclipse.I think some effort have bean made for the plugin to work with version 0.12 of m2eclipse , dont know if it's worked.
I already try the plugin with m2eclipse 0.10 and it worked well.
See GitHub m2eclipse-ajdt project
See Move AJDT integration out of main m2e source tree
在 maven
pom.xml
中添加 AspectJ 支持后,您必须将相关项目方面添加到 Eclipse 中的项目配置中。You will have to add the relevant project facets to your project configuration in eclipse after adding the AspectJ support in your maven
pom.xml
.如果您的 pom.xml 中有aspectj-maven-plugin,您将缺少一个 m2e 连接器:
我必须在 eclipse 中安装 m2e AJDT maven 插件配置器,但它一开始不起作用,因为我缺少依赖项。
因此,要开始安装此站点上提供的 AJDT 工具: http://download .eclipse.org/tools/ajdt/48/dev/update/
重新启动 eclipse,然后 m2e AJDT maven 插件配置器的安装应该可以工作。重新启动后,您应该可以使用 eclipse 来构建您的aspectj 类。
If you have the aspectj-maven-plugin in your pom.xml you'll get one missing m2e connector :
I had to install m2e AJDT maven plugin configurator in eclipse but it did not work at first because I had missing dependencies.
So to start install the AJDT tool available on this site : http://download.eclipse.org/tools/ajdt/48/dev/update/
Restart eclipse and then the install of m2e AJDT maven plugin configurator should work. After a new restart you should have eclipse available to build your aspectj classes.