Home java In maven, how to add driver jdbc postgres

In maven, how to add driver jdbc postgres

Author

Date

Category

I am trying to use jdbc Postgres to connect to a database in Java (IDE Eclipse framework Vaadin maven project build). In pom.xml, I manually insert the packing tag into the jar groupId, artifactId and Version

& lt; dependency & gt;
    & lt; groupId & gt; org.postgresql & lt; / groupId & gt;
    & lt; artifactId & gt; postgresql & lt; / artifactId & gt;
    & lt; version & gt; 9.4.1208-jdbc42-atlassian-hosted & lt; / version & gt;
  & lt; / dependency & gt; `

and I get errors:

Failed to execute goal on project OR: Could not resolve dependencies for project rts.appUI: OR: war: 1.0-SNAPSHOT: Failure to find org.postgresql: postgresql: jar: 9.4.1208-jdbc42-atlassian -hosted in

Tell me how to add a driver correctly?

Previously wrote one article about error java.lang.ClassNotFoundException: org.postgresql.Driver
here is the actual link for the article
There I had a problem with the driver, at the moment while adding driver org.postgresql


Answer 1, authority 100%

Something is wrong with your version.
Maybe you mean this?

& lt;! - https://mvnrepository.com/artifact/org.postgresql/postgresql - & gt;
& lt; dependency & gt;
  & lt; groupId & gt; org.postgresql & lt; / groupId & gt;
  & lt; artifactId & gt; postgresql & lt; / artifactId & gt;
  & lt; version & gt; 9.4.1208-atlassian-1 & lt; / version & gt;
& lt; / dependency & gt;

Look inside the repository which version you need.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions