放在classpath根目录(src/main/resources)中.
正确使用同一位置的application.properties文件.
这是代码:
@Controller
@EnableAutoConfiguration
public class TestResource {
@RequestMapping("/")
public @ResponseBody Map<String, String> test() {
return Collections.singletonMap("text", "test text");
}
public static void main(String[] args) {
SpringApplication.run(TestResource.class, args);
}
}
Run Code Online (Sandbox Code Playgroud) spring-boot ×1