Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
371 views
in Technique[技术] by (71.8m points)

aspectj-maven-plugin not covered by lifecycle in Kepler

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>

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>

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.)

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...