开普勒生命周期未涵盖的aspectj-maven-plugin [英] aspectj-maven-plugin not covered by lifecycle in Kepler

查看:140
本文介绍了开普勒生命周期未涵盖的aspectj-maven-plugin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚下载了OEPE(Kepler)并安装了m2e和m2e-wtp连接器. 我发现在以下路径下:首选项-> Maven->生命周期映射->打开工作区生命周期映射数据,有一个预配置的xml文件,其中说maven应当忽略AspectJ的编译目标,并且我认为这就是AspectJ运行时库是没有添加到项目中,因此该项目不会被eclipse识别为AspectJ项目.

I've just downloaded the OEPE (Kepler) and installed m2e and m2e-wtp connectors. I found out that under this path: Preferences ->Maven->Lifecycle mappings->Open workspace lifecycle mapping data there is a preconfigured xml file which says that maven should ignore the compile goal for AspectJ and I assume that's why the AspectJ runtime libraries are not added to the project hence the project is not recognized as an AspectJ project by eclipse.

<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
<pluginExecutions>
    <pluginExecution>
        <pluginExecutionFilter>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>aspectj-maven-plugin</artifactId>
            <versionRange>1.6</versionRange>
            <goals>
                <goal>compile</goal>
            </goals>
        </pluginExecutionFilter>
        <action>
            <ignore />
        </action>
    </pluginExecution>
</pluginExecutions>

我注释掉了xml文件中的这些行,然后再次将其重新加载. 现在,IDE不会在生命周期中忽略AspectJ插件标签,但pom文件抱怨它无法识别执行标签.

I commented out these lines in the xml file and reloaded it once again. Now the IDE does not ignore AspectJ plugin tag in the lifecycle but pom file is complaining that it cannot recognize the execution tag.

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.4</version>
<dependencies>
    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjrt</artifactId>
        <version>${aspectj.version}</version>
    </dependency>
</dependencies>
<configuration>
    <source>1.6</source>
    <target>1.6</target>
</configuration>
<executions>
    <execution>
        <goals>
            <goal>compile</goal>
        </goals>
    </execution>
</executions>
</plugin>

使用靛蓝,m2e-wtp能够识别Aspectj插件的<execution>标签,并能够添加AspectJ运行时库 自动进入项目,尽管开普勒不是这种情况. (我认为m2e-wtp的工作是从pom中制作AspectJ项目,但不是很确定.)

Using indigo the m2e-wtp was able to recognize the <execution> tag for aspectj plugin and able to add the AspectJ runtime libraries automatically to the project, though this is not the case in Kepler. (I think it is m2e-wtp's job to make an AspectJ project out of the pom but not quite sure.)

顺便说一句.我怎样才能使事情像Indigo一样? 我知道我可以右键单击该项目并将其转换为Aspect项目以解决该问题,但是我希望IDE和插件从pom文件中意识到该项目需要AspectJ jar.有什么主意吗?

Btw. the how can I make things work like in Indigo? I know I can right click on the project and convert it to aspect project in order to solve the problem but I want the IDE and plugins realize from the pom file that this project needs AspectJ jars. Any idea?

推荐答案

这是我的工作方式,首先通过从以下位置安装"AspectJ开发工具(AJDT)"和用于Eclipse的AspectJ编译器"来验证您已经安装了AJDT支持. AJDT更新站点: http://download.eclipse.org/tools/ajdt/43/update 您可以通过帮助/安装新软件"菜单项来完成此操作.

This is how I got it working, first verify you have installed AJDT support by installing "AspectJ Development Tools (AJDT)" and "AspectJ compiler for Eclipse" from the AJDT update site: http://download.eclipse.org/tools/ajdt/43/update You can do this through the "Help / Install new software" menu item.

然后,使用此更新站点通过安装AJDT M2E来手动安装M2E连接器: http://dist.springsource.org/release/AJDT/configurator/

Then, install the M2E connector manually by installing AJDT M2E using this update site: http://dist.springsource.org/release/AJDT/configurator/

这篇关于开普勒生命周期未涵盖的aspectj-maven-plugin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆