Postgresql driver not found for maven dependency

Issue

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 dependency:

<dependency>
  <groupId>org.postgresql</groupId>
  <artifactId>postgresql</artifactId>
  <version>9.3-1101-jdbc41</version>
</dependency>

It appears that Maven isn’t downloading the jar so the Driver class is not found. Any ideas?

Solution

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.

Answered By – Alex

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published