Classpath error: cannot find org.aspectj.lang.JoinPoint

I use maven to create my project. It successfully compiled earlier. It started to give an error when I do mvn clean install .

[ERROR] classpath error: unable to find org.aspectj.lang.JoinPoint (check that aspectjrt.jar is in your classpath)

Below is my pom.xml

 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.guavus</groupId> <artifactId>Exporter</artifactId> <version>atlas2.1</version> <packaging>jar</packaging> <name>Exporter</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <aspectj.version>1.6.10</aspectj.version> <org.springframework.version>3.0.5.RELEASE</org.springframework.version> </properties> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <version>3.0-beta-2</version> <configuration> <reportPlugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.7</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jxr-plugin</artifactId> <version>2.1</version> <configuration> <aggregate>true</aggregate> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-report-plugin</artifactId> <version>2.6</version> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.4</version> <configuration> <formats> <format>xml</format> <format>html</format> </formats> </configuration> </plugin> <!-- plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.6</version> </plugin --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>2.5</version> <configuration> <rulesets> <ruleset>/rulesets/basic.xml</ruleset> <ruleset>/rulesets/design.xml</ruleset> <ruleset>/rulesets/logging-java.xml</ruleset> </rulesets> <targetJdk>1.5</targetJdk> <format>xml</format> <linkXref>true</linkXref> <sourceEncoding>utf-8</sourceEncoding> <minimumTokens>100</minimumTokens> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> <version>2.3.1</version> </plugin> </reportPlugins> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId> <version>1.3</version> <configuration> <source>1.6</source> <target>1.6</target> <aspectDirectory>src/main/aspect</aspectDirectory> </configuration> <executions> <execution> <goals> <goal>compile</goal> <!-- use this goal to weave all your main classes --> </goals> </execution> </executions> <dependencies> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjtools</artifactId> <version>${aspectj.version}</version> </dependency> </dependencies> </plugin> </plugins> </build> <dependencies> <!-- local snapshots --> <dependency> <groupId>com.guavus</groupId> <artifactId>CubeCreator</artifactId> <version>atlas2.1</version> </dependency> <dependency> <groupId>com.guavus</groupId> <artifactId>ConcurrentFlows</artifactId> <version>atlas2.1</version> </dependency> <dependency> <groupId>ps</groupId> <artifactId>thriftGenerated</artifactId> <version>atlas2.1</version> </dependency> <!-- local snapshots --> <!-- local 3rd Party --> <dependency> <groupId>apache</groupId> <artifactId>libthrift</artifactId> <version>0.5.0</version> </dependency> <!-- local 3rd Party --> <!-- remote 3rd Party --> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-core</artifactId> <version>0.20.203.0</version> </dependency> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>1.7.1</version> </dependency> <!-- remote 3rd Party --> <!-- test libs --> <!-- test libs --> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.16</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.6.4</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-access</artifactId> <version>1.0.1</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.0.1</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> <version>1.0.1</version> </dependency> </dependencies> </project> 
+4
source share
4 answers

I would suggest that you lack addiction? Some Googling suggest you may need to import:

 <dependency> <groupId>aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>1.5.4</version> </dependency> 

Please note that 1.5.4 is the latest version being reported: http://mvnrepository.com/artifact/aspectj/aspectjrt

+4
source

It seems to come from

 <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjtools</artifactId> <version>${aspectj.version}</version> </dependency> 

Have you changed the next line recently?

 <aspectj.version>1.6.10</aspectj.version> 
+1
source

I got the same error

 [ERROR] error classpath error: unable to find org.aspectj.lang.JoinPoint (check that aspectjrt.jar is in your classpath) 

There is an aspectj-maven-plugin in the <plugin> tag, which is included when it tries to run the plugin, no dependency is found, which is the aspectjrt.jar file. If you are using aspectj-maven plugin, you need to add the following dependency to your pom.xml,

 <!-- AspectJ --> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>${aspectj.version}</version> </dependency> 

where aspectj.version is referred to in the tag as,

 <aspectj.version>1.8.1</aspectj.version> 
0
source

To run instantly, simply change the aspectj dependency area as follows:

 <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>${aspectj.version}</version> <scope>runtime</scope> </dependency> 
0
source

All Articles