Looking at the maven central repository the newest jdbc4 driver available for PostGresql is only the 9.1 driver
http://mvnrepository.com/artifact/postgresql/postgresql/9.1-901.jdbc4
There is a newer file called "postgresql-9.2-1002.jdbc4.jar" available on http://jdbc.postgresql.org/download.html but it has not been released to Maven central.
The PostgreSQL JDBC driver is available in the Maven central repository.
PostgreSQL provides a type 4 JDBC driver. Type 4 indicates that the driver is written in Pure Java, and communicates in the database system's own network protocol. Because of this, the driver is platform independent; once compiled, the driver can be used on any system.
It seems like PostgreSQL has updated their groupId
to org.postgresql
instead of postgresql
.
So now it is possible to use maven directly (mvnrepository.com):
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.2-1002-jdbc4</version>
</dependency>
Following dependency description works for me:
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.2-1002-jdbc4</version>
</dependency>
(This answer is now outdated; the jars have been released to maven under the groupid org.postgresql
. See more recent answers for details.)
You can simply install the driver to your local ~/.m2
repository. See the maven documentation and this question.
mvn install:install-file \
-DgroupId=postgresql \
-DartifactId=postgresql \
-Dpackaging=jar \
-Dversion=9.2-1002.jdbc4 \
-Dfile=postgresql-9.2-1002.jdbc4.jar \
-DgeneratePom=true
Alternately, if you're using Sonatype Nexus to manage repositories and caching - which I highly recommend - then you can add the jar to a locally maintained repository in your Nexus instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With