spring boot app

书史足自悦,安用勤与劬。这篇文章主要讲述spring boot app相关的知识,希望能为你提供帮助。
一个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-8spring: 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

【spring boot app】 

    推荐阅读