Roam
Roam

Reputation: 4949

aspectj not recognized in Maven plugin

I'm looking at the "spring-mvc-showcase" project-- an example on Spring dashboard. it is one on Github-- now downloaded on my disk.

i'm getting the following error:

Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.2:compile  (execution: default, phase: process-sources)

to this tag in the pom.xml file.

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>aspectj-maven-plugin</artifactId>
            <!-- Have to use version 1.2 since version 1.3 does not appear to work with ITDs -->
            <version>1.2</version>
                ....
                <execution>
                    <goals>
                        <goal>compile</goal>
                        <goal>test-compile</goal>
                    </goals>
                </execution>

                ....

No other error anywhere else in the package-- except for some warnings to unused APIs imported.

is this a version problem, something wrong w/my Maven installation...? im running the latest version of Maven.

This is a request for a quick fix. not good with Maven, new to the whole MVC framework and a warn out already.

Upvotes: 1

Views: 2292

Answers (2)

Marko Bonaci
Marko Bonaci

Reputation: 5708

I had the same problem, but it was due to a missing aspectjweaver maven dependency. You can get its details here.

I used the latest version, v1.8.4 for Eclipse Luna 4.4.1 and the errors went away.

Upvotes: 0

Karthik Prasad
Karthik Prasad

Reputation: 10004

M2E doesn't provide life cycle mapping for aspectj plugin. Here is how I had configured aspjectj

<pluginManagement>
            <plugins>

                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>aspectj-maven-plugin</artifactId>
                                        <versionRange>[1.0,)</versionRange>
                                        <goals>
                                            <goal>test-compile</goal>
                                            <goal>compile</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>






<!-- Aspectj compiler -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>aspectj-maven-plugin</artifactId> 
                <version>1.4</version> 
                <executions> 
                    <execution> 
                        <goals>
                            <goal>compile</goal> 
                        </goals> 
                        <configuration> 
                            <source>1.6</source> 
                            <target>1.6</target> 
                        </configuration> 
                    </execution> 
                </executions> 
            </plugin>

Upvotes: 5

Related Questions