springboot2.0版本JPA配置問題
spring:? ??datasource:? ????driver-class-name:?com.mysql.jdbc.Driver ????url:?jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8 ????username:?root ????password:?root ??jpa: ????hibernate: ??????ddl-auto:?update ????show-sql:?true
啟動項目時不報錯,控制臺也沒有數據庫相關的信息。也不能自動建表。
猜測應該是無法讀取到數據庫相關的配置吧。
版本:SpringBoot2.0.2
2018-11-16
遇到一樣的問題,控制臺控制臺也沒有數據庫相關的信息。也不能自動建表。還掃描不到repository?
springboot版本是2.0.3? 就存在這問題,我更換成 2.0.5就好了。 附上完整pom
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<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-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
? ? ? ? ? ? <groupId>org.springframework.boot</groupId>
? ? ? ? ? ? <artifactId>spring-boot-starter-web</artifactId>
? ? ? ? </dependency>
<!--jsp頁面使用jstl標簽-->
? ? ? ? <dependency>
? ? ? ? ? ? <groupId>javax.servlet</groupId>
? ? ? ? ? ? <artifactId>jstl</artifactId>
? ? ? ? </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
? ? ? ??
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
</dependencies>
2018-10-15
遇到同樣的問題,springboot版本是2.0.5,mysql是5.5,不知道是不是版本問題
2018-06-08
我也是這個問題 還掃描不到repository 樓主解決了嗎
2018-05-29
啟動項目時不報錯,控制臺也沒有數據庫相關的信息。也不能自動建表。
猜測應該是無法讀取到數據庫相關的配置吧。