From b74b5b154a8f1e9bf43ab2756898cf2b11282cc0 Mon Sep 17 00:00:00 2001 From: leebj Date: Fri, 2 Aug 2024 17:01:20 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 11 +++--- .../java/cokr/xit/fims/FimsApplication.java | 36 ++++++------------- 2 files changed, 16 insertions(+), 31 deletions(-) diff --git a/pom.xml b/pom.xml index d1724aac..d822dac1 100644 --- a/pom.xml +++ b/pom.xml @@ -87,12 +87,13 @@ fims-java 0.0.1-SNAPSHOT - + - cokr.xit.app - sgg-setting - ${sgg} - + cokr.xit.app + sgg-setting + ${sgg} + + diff --git a/src/main/java/cokr/xit/fims/FimsApplication.java b/src/main/java/cokr/xit/fims/FimsApplication.java index f71a5fbd..26cc1d1f 100644 --- a/src/main/java/cokr/xit/fims/FimsApplication.java +++ b/src/main/java/cokr/xit/fims/FimsApplication.java @@ -1,49 +1,33 @@ package cokr.xit.fims; - +import java.io.BufferedReader; import java.io.IOException; -import java.net.URL; -import java.util.Enumeration; -import java.util.jar.Attributes; -import java.util.jar.Manifest; +import java.io.InputStreamReader; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.ImportResource; +import org.springframework.core.io.ClassPathResource; import cokr.xit.base.ServletCustomizer; -import cokr.xit.base.boot.XitBaseApplication; import cokr.xit.fims.task.TaskMvcConfig; +import cork.xit.fims.SpringBootApplicationBridge; -@ImportAutoConfiguration({ServletCustomizer.class, TaskMvcConfig.class}) -@ImportResource("classpath:spring/context-*.xml") +@ImportAutoConfiguration({ServletCustomizer.class,TaskMvcConfig.class}) @ComponentScan(basePackageClasses = cokr.xit.applib.HttpStatusCodeExceptionControllerAdvice.class) -public class FimsApplication extends XitBaseApplication { +public class FimsApplication extends SpringBootApplicationBridge { public static void main(String[] args) { try { - Enumeration resources = FimsApplication.class.getClassLoader() - .getResources("META-INF/MANIFEST.MF"); - - while (resources.hasMoreElements()) { - URL e = resources.nextElement(); - String path = e.getPath(); - if(path.indexOf("sgg-setting") != -1) { - Manifest m = new Manifest(e.openStream()); - Attributes as = m.getMainAttributes(); - String sgg = as.getValue("sgg"); - System.setProperty("sgg", sgg); - break; - } - } + BufferedReader in = new BufferedReader(new InputStreamReader(new ClassPathResource("sgg.txt").getInputStream())); + String sgg = in.readLine(); + System.setProperty("sgg", sgg); + in.close(); } catch (IOException e) { e.printStackTrace(); } SpringApplication.run(FimsApplication.class, args); } - - }