`Getting NoClassDefFoundError Caused by: java.lang.ClassNotFoundException while trying to execute maven project. Created TestNG file and added classes.
Do we need to add configurations? The same code was getting executed earlier. I was trying to add extent reports code and then reverted. Not sure how to clean the project.Do we need to clear the dependecies and refresh?
Added extent reports dependencies and relevant code but reverted them`
1
This error arises generally when there are changes in configuration or dependencies. You can resolve it by trying few of the options
- Try
mvn clean
and thenmvn install
command - Try to remove the cache by trying ‘Invalidate Caches/Restart’ option of the IDE
- As the last option, try deleting the repository folder which is generated in the .m2 folder located under C:Users<username>, and then rebuild the project