10

I wanted to include Postgres JDBC driver in my Java application, so I added it as maven dependency. I chose the last version from this list, which happened to be, to my astonishment, hosted by Atlassian. Now I am receiving this error:

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

I also tried an older version that is not hosted by Atlassian, but got the same error! Is there another proper place to get the jar from?

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
  • 1
    Try this one: search.maven.org/… Commented Jan 19, 2017 at 8:29
  • Could you please post your pom or dependency? Commented Jan 19, 2017 at 8:29
  • Why are you trying to use a third-party dependency, instead of the official postgresql JDBC maven dependency? Commented Jan 19, 2017 at 9:18
  • Where is the official one, I found this on the mvnrepository.com, that is a part of my question: is there a better repository/host. Commented Jan 19, 2017 at 9:21
  • 1
    mvnrepository.com is just a view (index) of repo1.maven.org (and some other non-standard repository, like that one from Atlassian), but to answer your question: it is here: mvnrepository.com/artifact/org.postgresql/postgresql Commented Jan 19, 2017 at 21:14

4 Answers 4

23

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

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're using org.postgresql as the groupId, instead of postgresql.

Sign up to request clarification or add additional context in comments.

2 Comments

This one worked, but how did you find it? A google search wont get me to it!
@AHH jdbc.postgresql.org/download.html, links to Maven using the link search.maven.org/…
3

Should be:

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

Do not put the version. Let Maven does that itself

Comments

0

If you use DBeaver, try this:

  1. Choose Database option from menu,
  2. Driver manager,
  3. choose PostgreSQL and edit this,
  4. Go to Libraries and choose Add Artifact,
  5. Dependency Declaration,
  6. Paste your needed dependency (in the above answers) into it, and you're done

Comments

-2

Just downgrade the version of postgresql

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.