|
1 | | -package com.xiaour.spring.boot; |
2 | | - |
3 | | -import org.mybatis.spring.annotation.MapperScan; |
4 | | -import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration; |
5 | | -import org.springframework.beans.factory.annotation.Value; |
6 | | -import org.springframework.boot.SpringApplication; |
7 | | -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; |
8 | | -import org.springframework.boot.autoconfigure.SpringBootApplication; |
9 | | -import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; |
10 | | -import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer; |
11 | | -import org.springframework.boot.web.servlet.ServletComponentScan; |
12 | | -import org.springframework.boot.web.support.SpringBootServletInitializer; |
13 | | - |
14 | | -/** |
15 | | - * |
16 | | - * @ClassName Application |
17 | | - * @author Zhang.Tao |
18 | | - * @Date 2017年4月27日 下午5:30:34 |
19 | | - * @version V2.0.0 |
20 | | - */ |
21 | | - |
22 | | -@SpringBootApplication(exclude = MybatisAutoConfiguration.class) |
23 | | -@ServletComponentScan |
24 | | -@EnableAutoConfiguration |
25 | | -@MapperScan("com.xiaour.spring.boot.mapper") |
26 | | -public class Application extends SpringBootServletInitializer implements EmbeddedServletContainerCustomizer { |
27 | | - |
28 | | - @Value("${server.port}") |
29 | | - private int port;//应用的端口 |
30 | | - /** |
31 | | - * 启动入口 |
32 | | - * @param args |
33 | | - */ |
34 | | - public static void main(String ... args){ |
35 | | - SpringApplication.run(Application.class, args); |
36 | | - } |
37 | | - |
38 | | - /** |
39 | | - * 自定义端口 |
40 | | - */ |
41 | | - @Override |
42 | | - public void customize(ConfigurableEmbeddedServletContainer container) { |
43 | | - container.setPort(port); |
44 | | - } |
45 | | - |
46 | | -} |
| 1 | +package com.xiaour.spring.boot; |
| 2 | + |
| 3 | +import org.mybatis.spring.annotation.MapperScan; |
| 4 | +import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration; |
| 5 | +import org.springframework.beans.factory.annotation.Value; |
| 6 | +import org.springframework.boot.SpringApplication; |
| 7 | +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; |
| 8 | +import org.springframework.boot.autoconfigure.SpringBootApplication; |
| 9 | +import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; |
| 10 | +import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer; |
| 11 | +import org.springframework.boot.web.servlet.ServletComponentScan; |
| 12 | +import org.springframework.boot.web.support.SpringBootServletInitializer; |
| 13 | + |
| 14 | +/** |
| 15 | + * |
| 16 | + * @ClassName Application |
| 17 | + * @author Zhang.Tao |
| 18 | + * @Date 2017年4月27日 下午5:30:34 |
| 19 | + * @version V2.0.0 |
| 20 | + */ |
| 21 | + |
| 22 | +@SpringBootApplication(exclude = MybatisAutoConfiguration.class) |
| 23 | +@ServletComponentScan |
| 24 | +@MapperScan("com.xiaour.spring.boot.mapper") |
| 25 | +public class Application extends SpringBootServletInitializer implements EmbeddedServletContainerCustomizer { |
| 26 | + |
| 27 | + @Value("${server.port}") |
| 28 | + private int port;//应用的端口 |
| 29 | + /** |
| 30 | + * 启动入口 |
| 31 | + * @param args |
| 32 | + */ |
| 33 | + public static void main(String ... args){ |
| 34 | + SpringApplication.run(Application.class, args); |
| 35 | + } |
| 36 | + |
| 37 | + /** |
| 38 | + * 自定义端口 |
| 39 | + */ |
| 40 | + @Override |
| 41 | + public void customize(ConfigurableEmbeddedServletContainer container) { |
| 42 | + container.setPort(port); |
| 43 | + } |
| 44 | + |
| 45 | +} |
0 commit comments