Maven工程中遇到The import *** cannot be resolved问题

报错提示:

The import net.sf.json.JSONObject cannot be resolved。

原因分析:

Maven项目在编译的过程中,缺乏相应的jar包,可能是版本冲突,也可能是jar损坏,或者路径找不到。

解决方案:

下载相应的jar包,放到正确的路径下,如net.sf.json.JSONObject就是repository\net\sf\json。


jar包下载地址http://mvnrepository.com/

猜你喜欢

转载自blog.51cto.com/13402621/2152639