由於我不需要數據庫,啟動springboot報錯:
Cannot determine embedded database driver class for database type NONE
If you want an embedded database please put a supported one on the classpath.
If you have database settings to be loaded from a particular profile
you may need to active it (no profiles are currently active).
刪掉pom里全部相關數據庫的jar,也exclude相關DataSource的class,都不能解決,報錯依舊。最后:
pom增加:
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
完整的:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
<!-- Cannot determine embedded database driver class for database type
NONE 不需要調用數據源解決方法 -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
</dependencies>
注意:參考了以下網址方法,但並不能解決問題。
https://blog.csdn.net/hengyunabc/article/details/78762097