From 99e57abbc8c28c78dd1ac281cc0671f4ad67999a Mon Sep 17 00:00:00 2001 From: sukruthiarjula Date: Thu, 13 Jun 2024 16:21:20 -0700 Subject: [PATCH] fixed the build issue --- .../java/com/netflix/conductor/Conductor.java | 99 +++++++++---------- 1 file changed, 49 insertions(+), 50 deletions(-) diff --git a/server/src/main/java/com/netflix/conductor/Conductor.java b/server/src/main/java/com/netflix/conductor/Conductor.java index 9e2463e6c..d5775dd44 100644 --- a/server/src/main/java/com/netflix/conductor/Conductor.java +++ b/server/src/main/java/com/netflix/conductor/Conductor.java @@ -1,17 +1,14 @@ /* - * Copyright 2021-2024 DiffPlug - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2021-2024 Conductor Authors. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. */ package com.netflix.conductor; @@ -31,45 +28,47 @@ // In case that SQL database is selected this class will be imported back in the appropriate // database persistence module. @SpringBootApplication(exclude = DataSourceAutoConfiguration.class) -@ComponentScan(basePackages = { - "com.netflix.conductor", - "io.orkes.conductor", - "org.ccctech.apigateway.conductor" -}) +@ComponentScan( + basePackages = { + "com.netflix.conductor", + "io.orkes.conductor", + "org.ccctech.apigateway.conductor" + }) public class Conductor { - private static final Logger log = LoggerFactory.getLogger(Conductor.class); + private static final Logger log = LoggerFactory.getLogger(Conductor.class); - public static void main(String[] args) throws IOException { - loadExternalConfig(); - SpringApplication.run(Conductor.class, args); - } + public static void main(String[] args) throws IOException { + loadExternalConfig(); + SpringApplication.run(Conductor.class, args); + } - /** - * Reads properties from the location specified in CONDUCTOR_CONFIG_FILE and sets - * them as system properties so they override the default properties. - * - *

Spring Boot property hierarchy is documented here, - * https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config - * - * @throws IOException if file can't be read. - */ - private static void loadExternalConfig() throws IOException { - String configFile = System.getProperty("CONDUCTOR_CONFIG_FILE"); - if (StringUtils.isBlank(configFile)) { - configFile = System.getenv("CONDUCTOR_CONFIG_FILE"); - } - if (StringUtils.isNotBlank(configFile)) { - log.info("Loading {}", configFile); - FileSystemResource resource = new FileSystemResource(configFile); - if (resource.exists()) { - Properties properties = new Properties(); - properties.load(resource.getInputStream()); - properties.forEach((key, value) -> System.setProperty((String) key, (String) value)); - log.info("Loaded {} properties from {}", properties.size(), configFile); - } else { - log.warn("Ignoring {} since it does not exist", configFile); - } - } - } + /** + * Reads properties from the location specified in CONDUCTOR_CONFIG_FILE and sets + * them as system properties so they override the default properties. + * + *

Spring Boot property hierarchy is documented here, + * https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config + * + * @throws IOException if file can't be read. + */ + private static void loadExternalConfig() throws IOException { + String configFile = System.getProperty("CONDUCTOR_CONFIG_FILE"); + if (StringUtils.isBlank(configFile)) { + configFile = System.getenv("CONDUCTOR_CONFIG_FILE"); + } + if (StringUtils.isNotBlank(configFile)) { + log.info("Loading {}", configFile); + FileSystemResource resource = new FileSystemResource(configFile); + if (resource.exists()) { + Properties properties = new Properties(); + properties.load(resource.getInputStream()); + properties.forEach( + (key, value) -> System.setProperty((String) key, (String) value)); + log.info("Loaded {} properties from {}", properties.size(), configFile); + } else { + log.warn("Ignoring {} since it does not exist", configFile); + } + } + } }