简体   繁体   中英

How to add the Postgresql jdbc driver 9.2-1003-jdbc3 with Maven?

I have found the Postgresql JDBC4 driver here : http://mvnrepository.com/artifact/org.postgresql/postgresql/9.2-1003-jdbc4 .

But I can't seem to find the 9.2-1003-jdbc3 .

Do you know of an online maven repository that store it ?

Nota: I don't want to download the jar manually and then add it to my local maven repository.

The jdbc3 version of the 9.2-1003 postgresql artifact hasn't been published to Central. You'll need to stick with the most recent release that has been published ( 9.1-901.jdbc3 ), switch to jdbc4 (which is recommended if you're using Java 1.6 or later), or download from postgresql.org and install to your own repository.

Unless you have very specific requirements to use a long-unsupported JVM , moving to the jdbc4 driver is your best option.

好了,您将必须在本地存储库中将驱动程序的jar安装为依赖项(mvn install),然后您将能够使用maven的pom文件将此依赖项添加到任何项目中。

Simply add dependency to your POM file. The JAR will be downloaded automatically and placed in your local Maven's repository.

At least as for me this dependency worked and driver was added to my project:

<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>9.2-1003-jdbc4</version>
</dependency>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM