crayon_box
crayon_box

Reputation: 61

AspectJ not working using IntelliJ

For some reason IntelliJ doesn't pick up the AspectJ dependency so when I try to use any AspectJ library it does not recognize it even though the AspectJ jar is installed in my repository.

My pom.xml has the following:

...
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>1.6.11</version>
        </dependency>
...
                <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.5</source>
                                <target>1.5</target>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
...

So when I have any library such as these:

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;

they are not recognized and not available in the external libraries.

Upvotes: 1

Views: 4121

Answers (1)

crayon_box
crayon_box

Reputation: 61

I got it to work, I closed the project and re-imported it and now the AspectJ dependencies show up. I believe something was wrong with IntelliJ where it wasn't updating the dependencies that are in the repository.

Upvotes: 1

Related Questions