Pinky
Pinky

Reputation: 17

Unable to execute Maven project

`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`

Upvotes: 0

Views: 21

Answers (1)

Venkat Sai
Venkat Sai

Reputation: 59

This error arises generally when there are changes in configuration or dependencies. You can resolve it by trying few of the options

  1. Try mvn clean and then mvn install command
  2. Try to remove the cache by trying ‘Invalidate Caches/Restart’ option of the IDE
  3. 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

Upvotes: 0

Related Questions