How to use aspectj-maven-plugin

I am new to AspectJ and Maven.

I am trying to use aspectj-maven-plugin to create my project, but it does not work. I just followed the steps in AspectJ In Action 2 nd Edition.

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>aspectj-maven-plugin</artifactId>
            <executions>
                <execution>
                    <goals>
                        <goal>compile</goal>
                        <goal>test-compile</goal>
                    </goals>

                    <configuration>
                        <source>1.5</source>
                        <target>1.5</target>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Here is the error message I get in the line <execution>:

Plugin execution does not extend to life cycle configuration: org.codehaus.mojo: aspectj-maven-plugin: 1.4: compilation (execution: default, phase: compilation)

I am using JDK6 and Apache Maven 3.0.4.

+5
source share
3 answers

You need to install the AspectJ Maven configurator. It is available here:

http://dist.springsource.org/release/AJDT/configurator/

Help → Install new software ...

" " .

+9

aspectj-maven-plugin, pom.xml. eclipse.

:

<build>
    ....
    <pluginManagement>
        <plugins>
            <plugin> ... </plugin>
             ....
             ....
        </plugins>
    </pluginManagement>
</build>
+1

You can add the following:

<executionManger><execution>...<execution/><executionManger/>

he will work

0
source

All Articles