pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>persontest</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.3.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</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-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
<version>1.3.8.RELEASE</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.41</version>
</dependency>
</dependencies>
<!-- <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> -->
</project>
application.properties
#change server port
#server.port=8081
#mybatis Mapper object use @Mapper --- ObjectMapper.xml
#mybatis.mapper-locations=classpath:mapper/*Mapper.xml
#mybatis.config-location=classpath:mapper/config/sqlMapConfig.xml
#alias
#mybatis.type-aliases-package=persontest.demo.domain
#database
#spring.datasource.url=jdbc:mysql://localhost:3306/xxxx
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#spring.datasource.username=root
#spring.datasource.password=123456
#redis usage: @EnableCaching @Cacheable(value="unique key")
#spring.redis.host=192.168.0.76
#spring.redis.port=6379
#redis cluster
# usage:create class RedisConfig with annotaion @Configuration
# @Bean public JedisCluster getJedisCluster();
# inject value by @Value("${spring.redis.cluster.nodes}")
# @Autowired public JedisCluster jedisCluster;(a bean created above)
#spring.redis.cluster.nodes=192.168.0.1:8080,192.168.0.2:8082