Maven/AJDT project in Eclipse

Viewed 13692

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

6 Answers

If you have the aspectj-maven-plugin in your pom.xml you'll get one missing m2e connector :

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>aspectj-maven-plugin</artifactId>
            <version>1.11</version>
            <configuration>
                <includes>
                    <include>**/*aj</include>
                    <include>**/*java</include>
                </includes>
                <Xlint>ignore</Xlint>
                <source>1.8</source>
                <target>1.8</target>
                <complianceLevel>1.8</complianceLevel>
                <showWeaveInfo>true</showWeaveInfo>
                <weaveDependencies>
                    <weaveDependency>
                        <groupId>org.perf4j</groupId>
                        <artifactId>perf4j</artifactId>
                        <classifier>log4jonly</classifier>
                    </weaveDependency>
                </weaveDependencies>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

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.

Related