Project basic configuration

Configure some properties of the project:

modify properties to yml

1. application.properties -> application.yml

[application.yml]
spring:
  profiles:
    active: dev




2. Create branch configuration (optional)
 
   application-dev.yml application-hotfix.yml

first add POM dependencies
[pom.xml]
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
		
<dependency>
	<groupId>mysql</groupId>
	<artifactId>mysql-connector-java</artifactId>
</dependency>



[application-dev.yml]
spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://127.0.0.1:3306/springbootdb
    username: root
    password: root

  jpa:
    hibernate:
      ddl-auto: update
    show-sql: true









Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326335299&siteId=291194637