找不到Maven依赖的Postgresql驱动程序 [英] Postgresql driver not found for maven dependency
本文介绍了找不到Maven依赖的Postgresql驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Maven运行Spring项目,并且尝试使用postgresql.我已经将依赖项添加到pom.xml,但是在tomcat启动时,出现以下错误:
I am running a spring project with maven and I am trying to use postgresql. I've added the dependency to pom.xml, but at tomcat startup, I get the following error:
java.lang.ClassNotFoundException: org.postgresql.Driver
pom.xml依赖项:
pom.xml dependency:
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.3-1101-jdbc41</version>
</dependency>
看来Maven没有下载jar,所以找不到Driver类.有什么想法吗?
It appears that Maven isn't downloading the jar so the Driver class is not found. Any ideas?
推荐答案
Maven无法识别我已添加到pom.xml的新依赖项,因此我通过xml中的依赖关系视图"将其添加了,从而达到了目的.谢谢您的回答.
Maven wasn't recognizing the new dependency I have added to pom.xml, so I added it through 'Dependency view' from the xml and that did the trick. Thank you for your answers.
这篇关于找不到Maven依赖的Postgresql驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文