我已经阅读了几乎所有关于 H2 控制台的问题,但没有找到解决方案。当我点击 URL 时,我收到了Whitelabel Error Pagehttp://localhost:8080/h2-console。
我在我的项目中添加了以下依赖项:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>>
</dependency>
</dependencies>
application.properties
spring.h2.console.enabled=true
spring.datasource.url=jdbc:h2
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
紫衣仙女
相关分类