Reputation: 33581
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.
Upvotes: 20
Views: 21217
Reputation: 324511
(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.
Upvotes: 6
Reputation: 48075
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>
Upvotes: 25
Reputation: 81
Following dependency description works for me:
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.2-1002-jdbc4</version>
</dependency>
Upvotes: 8
Reputation: 118
You may use TypeSafe repository, it contains 9.2 driver. Use:
<repository>
<id>typesafe</id>
<url>http://repo.typesafe.com/typesafe/repo/</url>
</repository>
I hope that 9.2 driver will be on central repository soon, check https://github.com/pgjdbc/pgjdbc/issues/46 for progress.
Upvotes: 4
Reputation: 49085
I added the 9.2-1002 driver to my own crappy Maven repository that is hosted by Google Code (github wasn't popular a long time ago when I made it).
<repository>
<id>mvn-adamgent</id>
<url>http://mvn-adamgent.googlecode.com/svn/maven/release</url>
<name>Adam Gent Maven Repository</name>
</repository>
I tried to go and fix the postgres build to build me a JDBC3 driver but I think you have to install an older JDK to get that working so I just grabbed the jars from: http://jdbc.postgresql.org/download.html
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.2-1002.jdbc4</version>
</dependency>
I also included a source jar (so Maven will auto download the source for you) but I did not make Javadoc or JDBC3 jar.
If I only knew how to make the JDBC3 jar correctly I could make the changes to their build file (@Craig Ringer) on my github fork.
Upvotes: 0