refactor: migrate to YAML config and add Maven dev/prod profiles

- Replace application.properties with application.yaml (base/prod config)
  and application-dev.yaml (dev overrides: show-sql=true)
- Add Maven 'dev' profile (activeByDefault) and 'prod' profile to pom.xml;
  spring-boot:run picks up the active Spring profile automatically
- Guard DataInitializer.initData with @Profile("dev") so test data is
  never seeded in production

Local dev: ./mvnw spring-boot:run (dev profile active by default)
Production: SPRING_PROFILES_ACTIVE env var controls the Spring profile;
            Maven profiles are irrelevant for the packaged JAR.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-03-15 12:21:16 +01:00
parent 107cec8a2f
commit adee746b23
5 changed files with 70 additions and 28 deletions

View File

@@ -0,0 +1,42 @@
spring:
application:
name: Familienarchiv
datasource:
url: ${SPRING_DATASOURCE_URL}
username: ${SPRING_DATASOURCE_USERNAME}
password: ${SPRING_DATASOURCE_PASSWORD}
driver-class-name: org.postgresql.Driver
jpa:
hibernate:
ddl-auto: none
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
show-sql: false
servlet:
multipart:
max-file-size: 50MB
max-request-size: 50MB
app:
s3:
endpoint: ${S3_ENDPOINT}
access-key: ${S3_ACCESS_KEY}
secret-key: ${S3_SECRET_KEY}
bucket: ${S3_BUCKET_NAME}
region: ${S3_REGION}
admin:
username: ${APP_ADMIN_USERNAME:admin}
password: ${APP_ADMIN_PASSWORD:admin123}
import:
excel:
col:
filename: 0
date: 1
location: 2
transcription: 3