一个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

启动 : mvn spring-boot:run 或者 直接运行main 方法

spring boot app的更多相关文章

  1. https Configure a Spring Boot app for HTTPS on Amazon AWS.

    参考: https://geocolumbus.github.io/HTTPS-ELB-AWS-Spring-Boot/ 1.  在服务器端配置  证书 域名 映射 2. 导入依赖: <depe ...

  2. 新建一个新的spring boot项目

    简单几步,在Eclipse中创建一个新的spring Boot项目: 1.Eclipse中安装STS插件: Help -> Eclipse Marketplace... Search或选择&qu ...

  3. Building a RESTful Web Service Using Spring Boot In Eclipse

    一.构建restful web service 创建Maven的java web工程,maven的pom文件加入依赖包 创建包hello Greeting.java package hello; pu ...

  4. Spring boot 内存优化

    转自:https://dzone.com/articles/spring-boot-memory-performance It has sometimes been suggested that Sp ...

  5. Manage Spring Boot Logs with Elasticsearch, Logstash and Kibana

    下载地址:https://www.elastic.co/downloads When time comes to deploy a new project, one often overlooked ...

  6. Spring Boot Memory Performance

    The Performance Zone is brought to you in partnership with New Relic. Quickly learn how to use Docke ...

  7. Spring Boot 分布式Session状态保存Redis

    在使用spring boot做负载均衡的时候,多个app之间的session要保持一致,这样负载到不同的app时候,在一个app登录之后,而打到另外一台服务器的时候,session丢失. 常规的解决方 ...

  8. Spring Boot 负载均衡之外置session状态保存

    在使用spring boot做负载均衡的时候,多个app之间的session要保持一致,这样负载到不同的app时候,在一个app登录之后,而打到另外一台服务器的时候,session丢失. 常规的解决方 ...

  9. [读书笔记] 一、Spring boot项目搭建与配置文件

    读书笔记:[JavaEE开发的颠覆者 Spring Boot实战] 作者:汪云飞 从今天开始坚持读书,并记录下此读书笔记. 一,初接触 Spring boot 项目Hello world搭建 1.po ...

随机推荐

  1. PopupWindow-----点击弹出 PopupWindow 初始化菜单

    /** * 点击弹出 PopupWindow 初始化菜单 */ private void initPopupWindow() { PopupWindowAdapter adapter = new Po ...

  2. NLTK与NLP原理及基础

    参考https://blog.csdn.net/zxm1306192988/article/details/78896319 以NLTK为基础配合讲解自然语言处理的原理  http://www.nlt ...

  3. phper 需要学习js

  4. 2018 - Start Up

    转眼2017已经过去,从大四下学期出来实习,到现在工作一年多了,很遗憾没有经营好自己博客园&CSDN. 献上一篇鼓励工程师写blog的博客:https://kb.cnblogs.com/pag ...

  5. ld 链接选项-L,-rpath-link,-rpath

    转载自:http://blog.csdn.net/q1302182594/article/details/42102961 1. 三个C文件 1. world.c #include<stdio. ...

  6. Python 使用其他邮件服务商的 SMTP 访问(QQ、网易、163、Google等)发送邮件

    163邮箱SMTP授权 使用Python SMTP发送邮件 # -*- coding:utf-8 -*- from __future__ import print_function __author_ ...

  7. string为什么是final?源码分析

    http://blog.csdn.net/zhangjg_blog/article/details/18319521

  8. POJ 2686 Traveling by Stagecoach (状压DP)

    题意:有一个人从某个城市要到另一个城市, 有n个马车票,相邻的两个城市走的话要消耗掉一个马车票.花费的时间呢,是马车票上有个速率值 ,问最后这个人花费的最短时间是多少. 析:和TSP问题差不多,dp[ ...

  9. Business Trip to Taian

    工作必备 电脑.电源(下载好小助手.VPN.个人证书) 手机.充电器 重要参考书籍 生活用品 衣服,夏天体恤为主,别忘了加件外套 被罩.床单和枕巾 牙刷牙膏肥皂之类的必带,中号浴巾一条 拖鞋要不要? ...

  10. 使用docker的kms服务器激活office2016专业增强版

    我安装了office2016专业增强版,使用自己搭建的kms激活服务器无法激活,回来使用了一下脚本: 感谢,rainfarm的博主.博客地址:http://blog.sina.com.cn/s/blo ...