The pom.xml of my maven project looks as follows:
I got this error but through ton of Googling, I could not find the solution. All the answers are about the path, nobody cares that It can run in Eclipse but not in exported jar file :(
But now I found solution, so simple: In Eclipse right click on your maven project-> Properties -> Java build path -> Source Tab
You can see a tree like :
MyProject/src
Ouput follder..
Included (**/*.java)
Excluded
...
Double click on Included (**/*.java)
, remove the existing one so It become Included (All)
Now export the jar file :)