标签:pen root timeout upd encoding web ddl pid localhost
一个demo 可以参考一下
AppConfig
@Configuration @ComponentScan(basePackages = { "org.whm.test" }) @EnableAutoConfiguration public class AppConfig { public static void main(String[] argss) { String[] args = { "--spring.config.location=classpath:config/app.yml" }; SpringApplication.run(AppConfig.class, args); } }
pom.xml
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.4.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency> </dependencies>
app.yml
server:
port: 8099
session-timeout: 30
tomcat.max-threads: 0
tomcat.uri-encoding: UTF-8
spring:
aop:
auto: true
datasource:
url : jdbc:mysql://localhost:3306/newbirds
username : root
password : mymysql
driverClassName : com.mysql.jdbc.Driver
jpa:
database : MYSQL
show-sql : true
hibernate:
ddl-auto : update
naming-strategy : org.hibernate.cfg.ImprovedNamingStrategy
properties:
hibernate:
dialect : org.hibernate.dialect.MySQL5Dialect
标签:pen root timeout upd encoding web ddl pid localhost
原文地址:http://www.cnblogs.com/whm-blog/p/7239109.html