Tuesday, April 26, 2016

Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin


Problem :


Trying to build my project in Maven , getting below error and build unsuccessful

ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.2:compile (default) on project DrillingBestPractices: Compiler errors :

[ERROR] error at import org.apache.catalina.connector.Request;
[ERROR] ^^^^^^^^^^^^^^^^^^

[ERROR]  absolute Path of my class
The import org.apache.catalina cannot be resolved


Solution :

The import was not being used in the class , so just had to delete it from the related class. and then the project was successfully built in Maven.

Surprise :

IDE was not complaining about this import , no compilation error which means the related jar file was in the build path. IDE however was showing me an un used warning for this import. It is strange that Maven was actually complaining about this import. However as said in the solution problem was resolved by removing the unused import in error message.

Lesson Learned :


Pay close attention to Maven error log and you will find a hint where the problem might be.