Get rid of custom.properties

This commit is contained in:
Andrew Shcherbakov 2019-08-05 19:57:12 +02:00
parent 1ccfdebc41
commit 4b7d77eb1d
2 changed files with 2 additions and 15 deletions

View File

@ -1,24 +1,13 @@
package com.baeldung.idc;
import java.util.HashMap;
import java.util.Map;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
@SpringBootApplication
@ComponentScan(basePackages = "com.baeldung.idc")
@PropertySource(value = { "classpath:/custom.properties" }, ignoreResourceNotFound = true)
public class Application {
public static void main(String[] args) {
final SpringApplicationBuilder builder = new SpringApplicationBuilder(Application.class);
final Map<String, Object> map = new HashMap<>();
map.put("spring.config.name", "custom.properties");
builder.properties(map).run(args);
SpringApplication.run(Application.class, args);
}
}

View File

@ -1,2 +0,0 @@
server.port=8080
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration