我有一个spring boot项目,当我通过eclipse执行时它运行得很好 Project > Run as > spring boot app
但是当我构建项目并java -jar myproject.jar使用mvn spring-boot:run它执行或使用它运行它时会抛出此错误
Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource:
Property: driverclassname
Value: com.microsoft.sqlserver.jdbc.SQLServerDriver
Origin: "driverClassName" from property source "source"
Reason: Failed to load driver class com.microsoft.sqlserver.jdbc
.SQLServerDriver in either of HikariConfig class loader or Thread context classloader
Action:
Update your application's configuration
我的 sql server 连接器依赖项
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.4.0.jre8</version>
<scope>test</scope>
</dependency>
这里是我的 application.properties
spring.datasource.url=jdbc:sqlserver://mydb;databaseName=HTSdb
spring.datasource.username=xxx
spring.datasource.password=xxx
spring.jpa.show-sql=true
spring.jpa.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect
看起来我的应用程序找不到 sqlserver 驱动程序,但它已经在项目类路径中,有什么建议吗?提前致谢
森栏
相关分类