Java ClassNotFoundException:org.postgresql.Driver
我有以下maven依赖项:Java ClassNotFoundException:org.postgresql.Driver,java,spring,classnotfoundexception,Java,Spring,Classnotfoundexception,我有以下maven依赖项: <postgresql.version>42.2.11</postgresql.version> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <version>${postgresql.ver
<postgresql.version>42.2.11</postgresql.version>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>
SDK是11.0.6
我试过:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project user_service: Fatal error compiling
postgresql
postgresql
9.1-901-1.jdbc4
已尝试,但:未能在central()中找到工件org.postgresql:postgresql:pom:9.1-901-1.jdbc4
java.lang.ClassNotFoundException: org.postgresql.Driver
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass
.....
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project user_service: Fatal error compiling
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901-1.jdbc4</version>
</dependency>