설정 수정

main
이범준 4 months ago
parent e73780b13b
commit b74b5b154a

@ -87,12 +87,13 @@
<artifactId>fims-java</artifactId> <artifactId>fims-java</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cokr.xit.app</groupId> <groupId>cokr.xit.app</groupId>
<artifactId>sgg-setting</artifactId> <artifactId>sgg-setting</artifactId>
<version>${sgg}</version> <version>${sgg}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

@ -1,49 +1,33 @@
package cokr.xit.fims; package cokr.xit.fims;
import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.io.InputStreamReader;
import java.util.Enumeration;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.context.annotation.ComponentScan; 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.ServletCustomizer;
import cokr.xit.base.boot.XitBaseApplication;
import cokr.xit.fims.task.TaskMvcConfig; import cokr.xit.fims.task.TaskMvcConfig;
import cork.xit.fims.SpringBootApplicationBridge;
@ImportAutoConfiguration({ServletCustomizer.class, TaskMvcConfig.class}) @ImportAutoConfiguration({ServletCustomizer.class,TaskMvcConfig.class})
@ImportResource("classpath:spring/context-*.xml")
@ComponentScan(basePackageClasses = cokr.xit.applib.HttpStatusCodeExceptionControllerAdvice.class) @ComponentScan(basePackageClasses = cokr.xit.applib.HttpStatusCodeExceptionControllerAdvice.class)
public class FimsApplication extends XitBaseApplication { public class FimsApplication extends SpringBootApplicationBridge {
public static void main(String[] args) { public static void main(String[] args) {
try { try {
Enumeration<URL> resources = FimsApplication.class.getClassLoader() BufferedReader in = new BufferedReader(new InputStreamReader(new ClassPathResource("sgg.txt").getInputStream()));
.getResources("META-INF/MANIFEST.MF"); String sgg = in.readLine();
System.setProperty("sgg", sgg);
while (resources.hasMoreElements()) { in.close();
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;
}
}
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
SpringApplication.run(FimsApplication.class, args); SpringApplication.run(FimsApplication.class, args);
} }
} }

Loading…
Cancel
Save