SpringBoot类路径maven依赖

时间:2018-06-19 07:03:10

标签: java maven spring-boot

我已将此postgres依赖项添加到我的pom.xml

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

我正在使用mvn spring-boot:run开始我的服务。我收到此错误消息:

  

无法加载驱动程序类:“org.postgresql.Driver”

我查看了jar

中的BOOT-INF\lib\文件

enter image description here

我的application.yml

spring:
  jpa:
    generate-ddl: false
    show-sql: true
    properties:
      hibernate:
        format_sql: true
        jdbc:
          lob:
            non_contextual_creation: true

  liquibase: 
    enabled: false

  profiles:
    active: 'local'

我的application-local.properties

spring.datasource.url: "jdbc:postgresql://host:port/db"
spring.datasource.username: "username"
spring.datasource.password: "password"
spring.datasource.driverClassName: "org.postgresql.Driver"

0 个答案:

没有答案
相关问题