From 3647c9907fcfbba4fd08b4a94a0bb821eb0a1a79 Mon Sep 17 00:00:00 2001 From: leebj Date: Mon, 29 Jul 2024 17:48:36 +0900 Subject: [PATCH] no message --- pom.xml | 10 +++++- .../java/cokr/xit/fims/FimsApplication.java | 32 ++++++++++++++++--- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 5513ad63..e9cff502 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,7 @@ UTF-8 17 + 10000 @@ -75,8 +76,15 @@ fims-java 0.0.1-SNAPSHOT - + + + 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 a793a83f..bca0759f 100644 --- a/src/main/java/cokr/xit/fims/FimsApplication.java +++ b/src/main/java/cokr/xit/fims/FimsApplication.java @@ -1,5 +1,12 @@ package cokr.xit.fims; + +import java.io.IOException; +import java.net.URL; +import java.util.Enumeration; +import java.util.jar.Attributes; +import java.util.jar.Manifest; + import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.context.annotation.ComponentScan; @@ -15,12 +22,29 @@ import cokr.xit.fims.task.TaskMvcConfig; public class FimsApplication extends XitBaseApplication { public static void main(String[] args) { - String sysSgg = System.getProperty("sgg.active"); - if(sysSgg == null || sysSgg.equals("")) { - System.out.println("시군구 설정 없음"); - return; + + try { + Enumeration resources = FimsApplication.class.getClassLoader() + .getResources("META-INF/MANIFEST.MF"); + + while (resources.hasMoreElements()) { + URL e = resources.nextElement(); + String path = e.getPath(); + System.out.println(path); + 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; + } + } + } catch (IOException e) { + e.printStackTrace(); } SpringApplication.run(FimsApplication.class, args); } + + }