Properties ↔ YAML Converter
Spring Bootのapplication.propertiesとapplication.ymlファイルを相互変換するツールです。設定ファイルのマイグレーションとリファクタリングに必須!
📄 Properties → YAML
Output will appear here...
💡 Spring Boot Configuration Tips
Properties 장점:
- 간단하고 직관적
- 한 줄에 하나의 설정
- 검색하기 쉬움
YAML 장점:
- 계층 구조가 명확
- 중복 줄임
- 가독성 좋음
주의사항:
- YAML은 들여쓰기에 민감 (스페이스만 사용)
- Properties는 특수문자 이스케이프 필요
- Profile별 파일 분리 권장
Properties vs YAML
Properties形式
spring.datasource.url=jdbc:mysql://localhost:3306/mydb
spring.datasource.username=root
spring.datasource.password=secret
server.port=8080
YAML形式
spring:
datasource:
url: jdbc:mysql://localhost:3306/mydb
username: root
password: secret
server:
port: 8080
いつ使うの?
Properties → YAML変換
- プロジェクトをYAMLに移行する時
- 階層構造を明確に見たい時
- 重複プレフィックスを削減したい時
- 可読性を向上させたい時
YAML → Properties変換
- レガシーシステムとの互換性
- シンプルな設定を好む
- 検索とgrepが簡単
- IDEの自動補完がより良く動作
実際の使用例
データベース設定
Properties:
# Database Configuration
spring.datasource.url=jdbc:mysql://localhost:3306/mydb
spring.datasource.username=root
spring.datasource.password=secret123
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
YAML:
# Database Configuration
spring:
datasource:
url: jdbc:mysql://localhost:3306/mydb
username: root
password: secret123
driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
hibernate:
ddl-auto: update
show-sql: true
サーバー & ロギング設定
Properties:
server.port=8080
server.servlet.context-path=/api
server.compression.enabled=true
logging.level.root=INFO
logging.level.com.example=DEBUG
logging.file.name=logs/application.log
logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} - %msg%n
YAML:
server:
port: 8080
servlet:
context-path: /api
compression:
enabled: true
logging:
level:
root: INFO
com.example: DEBUG
file:
name: logs/application.log
pattern:
console: '%d{yyyy-MM-dd HH:mm:ss} - %msg%n'