原因:我在maven的settings.xml中配置了localRepository,导致虽然可以下载jar包但是用不了。 解决:删掉xml文件中自己localRepository的配置,可以在设置中选择文件夹去修改本地仓库。