Application.java
1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package com.glsx.publicservice;
import com.alibaba.dubbo.spring.boot.annotation.EnableDubboConfiguration;
import com.github.tobato.fastdfs.FdfsClientConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* @author zhanghj
* @version 1.0.0
* @Title Application.java
* @Package com.glsx.usercenter
* @Description TODO
* @date 2019年1月16日 下午2:25:01
*/
@SpringBootApplication
@ComponentScan("com.glsx")
@ServletComponentScan
@EnableEurekaClient
@EnableDiscoveryClient
@EnableFeignClients(basePackages = {"com.glsx.common.feign.client"})
@EnableTransactionManagement
@EnableDubboConfiguration
@MapperScan(basePackages = {"com.glsx.publicservice.mapper"})
//@ImportResource(locations = { "classpath:config/applicationContext-dubbo.xml"})
@Import(FdfsClientConfig.class)
public class Application extends SpringBootServletInitializer {
/**
* 本地启动 ,内嵌tomcat方式
*
* @param args
*/
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
/**
* 打包项目,单独部署tomcat
*/
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(Application.class);
}
}