From 9090095dafb950289cbffd0627d0ba47c2f69974 Mon Sep 17 00:00:00 2001 From: Baoqi Wu Date: Mon, 18 Nov 2019 14:58:41 +0800 Subject: [PATCH] disable Import on Combined Server to solve API Server not work issue (#1268) --- .../api/CombinedApplicationServer.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/CombinedApplicationServer.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/CombinedApplicationServer.java index c4e80cd4eb..5030890ae4 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/CombinedApplicationServer.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/CombinedApplicationServer.java @@ -21,17 +21,19 @@ import org.apache.dolphinscheduler.server.master.MasterServer; import org.apache.dolphinscheduler.server.rpc.LoggerServer; import org.apache.dolphinscheduler.server.worker.WorkerServer; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Import; import springfox.documentation.swagger2.annotations.EnableSwagger2; -//@SpringBootApplication -//@ServletComponentScan -//@ComponentScan("org.apache.dolphinscheduler") -//@Import({MasterServer.class, WorkerServer.class}) -//@EnableSwagger2 +@SpringBootApplication +@ConditionalOnProperty(prefix = "server", name = "is-combined-server", havingValue = "true") +@ServletComponentScan +@ComponentScan("org.apache.dolphinscheduler") +@Import({MasterServer.class, WorkerServer.class}) +@EnableSwagger2 public class CombinedApplicationServer extends SpringBootServletInitializer { public static void main(String[] args) throws Exception {