Postgres JDBC maven dependency not found

I wanted to include the Postgres JDBC driver in my Java application, so I added it as a maven dependency. I chose the latest version from this list , which, to my surprise, was hosted by Atlassian. Now I get this error:

Missing artifact postgresql: postgresql: jar: 9.4.1208-jdbc42-atlassian-hosting

I also tried an older version that was not posted by Atlassian but got the same error! Is there any other suitable place to get a can?

This is my current pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>PostgresListener</groupId> <artifactId>PostgresListener</artifactId> <version>0.0.1-SNAPSHOT</version> <build> <sourceDirectory>src</sourceDirectory> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.5.1</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> <dependencies> <!-- https://mvnrepository.com/artifact/postgresql/postgresql --> <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> <version>9.4.1208-jdbc42-atlassian-hosted</version> </dependency> </dependencies> 

+5
source share
2 answers

What exactly do you have in the pom.xml file?

It should be something like:

 <!-- https://mvnrepository.com/artifact/org.postgresql/postgresql --> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <version>9.4.1212</version> </dependency> 

Make sure you use org.postgresql as groupId instead of postgresql .

+16
source

Must be:

 <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> </dependency> 

Do not put the version. Let Maven do it himself

+3
source

Source: https://habr.com/ru/post/1263041/


All Articles