# Application Properties & YAML (Spring Boot) > application.properties/yml, @Value, @ConfigurationProperties, profiles, 외부 프로퍼티를 사용한 설정 - 16 면접 질문 - Junior - [면접 질문: Spring Boot](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions.md) ## 1. Spring Boot에서 application.properties와 application.yml의 주요 차이점은 무엇인가요? **답변** 두 파일 모두 Spring Boot를 설정하는 데 사용되지만, 서로 다른 형식을 사용합니다. YAML 형식(.yml)은 들여쓰기를 통한 계층 구조를 허용하여 복잡한 설정에 대해 더 읽기 쉽습니다. properties 형식(.properties)은 평면적인 key=value 구문을 사용합니다. Spring Boot는 둘 중 하나를 자동으로 로드하며, 둘 다 존재하는 경우 .properties가 우선합니다. ## 2. Spring Boot에서 내장 서버 포트를 변경할 수 있는 프로퍼티는 무엇인가요? **답변** server.port 프로퍼티는 내장 서버(Tomcat, Jetty, Undertow)의 HTTP 포트를 설정합니다. 기본적으로 Spring Boot는 포트 8080에서 시작합니다. 이 프로퍼티는 application.properties(server.port=9000) 또는 YAML(server: port: 9000)에서 정의할 수 있습니다. 또한 JVM 인자(-Dserver.port=9000)나 환경 변수로 재정의할 수도 있습니다. ## 3. 로컬 PostgreSQL 데이터베이스를 위해 YAML에서 spring.datasource.url 프로퍼티를 어떻게 선언하나요? **답변** YAML에서 계층적 프로퍼티는 들여쓰기(탭이 아닌 공백)를 사용합니다. spring.datasource.url 프로퍼티는 spring → datasource → url로 분해됩니다. 각 레벨은 공백 2칸으로 들여쓰기됩니다. 이 계층 구조는 평면적인 properties 버전(spring.datasource.url=jdbc:postgresql://localhost:5432/mydb)보다 설정을 더 읽기 쉽게 만듭니다. ## 13개 추가 질문 이용 가능 - Spring Boot 애플리케이션 시작 시 'dev' profile을 활성화하려면 어떻게 하나요? - Spring 빈에 구성 프로퍼티를 주입할 수 있는 어노테이션은 무엇입니까? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 Spring Boot 면접 주제 - [Spring Core - IoC & DI](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-core-ioc-di.md): 22개 질문, Junior - [Spring Boot Auto-Configuration](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-boot-auto-configuration.md): 20개 질문, Junior - [Spring Boot Starters](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-boot-starters.md): 18개 질문, Junior - [SLF4J 및 Logback을 사용한 로깅](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/logging.md): 20개 질문, Junior - [Spring Boot DevTools](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-boot-devtools.md): 15개 질문, Junior - [Spring MVC Basics](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-mvc-basics.md): 20개 질문, Mid-Level - [Spring REST Controllers](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-rest-controllers.md): 20개 질문, Mid-Level - [Request & Response Handling](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/request-response-handling.md): 20개 질문, Mid-Level - [예외 처리](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/exception-handling.md): 25개 질문, Mid-Level - [Bean Validation](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/bean-validation.md): 25개 질문, Mid-Level - [Spring Data JPA 기초](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-data-jpa-basics.md): 25개 질문, Mid-Level - [JPA 엔티티 및 관계](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/jpa-entities-relationships.md): 30개 질문, Mid-Level - [JPA 쿼리](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/jpa-queries.md): 30개 질문, Mid-Level - [Spring Data Repositories](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-data-repositories.md): 25개 질문, Mid-Level - [Spring Security 기초](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-security-basics.md): 25개 질문, Mid-Level - [Spring Boot Actuator](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-boot-actuator.md): 20개 질문, Mid-Level - [JUnit과 Mockito를 사용한 단위 테스트](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/testing-junit-mockito.md): 30개 질문, Mid-Level - [Spring Boot 테스트](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-boot-testing.md): 30개 질문, Mid-Level - [Profiles와 Environment](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/profiles-environment.md): 20개 질문, Mid-Level - [RestTemplate 및 WebClient](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/resttemplate-webclient.md): 24개 질문, Mid-Level - [Async와 스케줄링](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/async-scheduling.md): 25개 질문, Mid-Level - [Spring을 사용한 캐싱](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/caching.md): 25개 질문, Mid-Level - [Spring WebFlux (리액티브)](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-webflux.md): 25개 질문, Mid-Level - [Spring 트랜잭션](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/transactions.md): 30개 질문, Senior - [고급 인증 및 인가](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/authentication-authorization.md): 30개 질문, Senior - [JWT 및 스테이트리스 보안](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/jwt-stateless-security.md): 20개 질문, Senior - [OAuth2와 Authorization Server](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/oauth2-authorization-server.md): 20개 질문, Senior - [Spring Boot와 Docker](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-boot-docker.md): 19개 질문, Senior - [Spring을 활용한 마이크로서비스](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/microservices-basics.md): 25개 질문, Senior - [Spring Cloud Config](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/spring-cloud-config.md): 19개 질문, Senior - [성능 최적화](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/performance-optimization.md): 30개 질문, Senior - [GraalVM Native Images](https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/graalvm-native-images.md): 20개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/spring-boot/interview-questions/application-properties-yml