Sample of Kotlin on Spring Boot.
gradlew build
is deprecate.
Instead of gradlew clean build -x runKtlintCheckOverMainSourceSet -x test
.
Cause: gradle-ktlint
has bug.
Issue: https://github.com/JLLeitschuh/ktlint-gradle/issues/579
Note:
To save time, test step excluded from the build task.
If other tasks also fail related to ktlint
, use the -x
option to exclude them.
gradlew clean build -x runKtlintCheckOverMainSourceSet -x test
Set kotlin formatter for IntelliJ.
gradlew ktlintApplyToIdea
gradlew ktlintFormat
Init datasource.
docker-compose -f docker-compose.yaml -p kotlin-on-spring-boot up -d
If only ktlintCheck
is used, it succeeds.
gradlew ktlintCheck
Case Windows: Use git-bash.
touch $HOME/.testcontainers.properties
echo "testcontainers.reuse.enable=true" > $HOME/.testcontainers.properties
When not work test, then run build command.
gradlew test
gradlew bootRun
docker-compose down
デモ用のRenderのサーバとローカル起動サーバでSwaggerにてエンドポイントの確認が行える https://rami2076.github.io/kotlin-on-spring-boot/swagger/
ローカルで確認する時は下記 Swagger-UI
サーバのデプロイにRenderを利用している。 以下はデプロイ後の Health CheckへのURL