{"id":23583443,"url":"https://github.com/kinto-technologies/springboot3batchstarter","last_synced_at":"2025-11-02T23:30:27.309Z","repository":{"id":269380601,"uuid":"779084033","full_name":"kinto-technologies/SpringBoot3BatchStarter","owner":"kinto-technologies","description":"Spring Batch 5 skeleton for Spring Boot 3. Includes DB to CSV and CSV to DB samples for quick customization. This repository demonstrates multi-database setup, efficient batch processing, and GitHub Actions integration for CI/CD pipelines.","archived":false,"fork":false,"pushed_at":"2024-12-28T03:59:24.000Z","size":189,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-01T08:42:44.623Z","etag":null,"topics":["chunk","ci-cd","csv","data-integration","database-migration","datasource","docker","github-actions","h2","java","job-configuration","jooq","multi-database","mysql","opencsv","skeleton-code","spring-batch-5","spring-boot-3","spring-framework","tasklet"],"latest_commit_sha":null,"homepage":"https://blog.kinto-technologies.com/posts/2024-12-25_copy_paste_spring_batch5_boot3","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kinto-technologies.png","metadata":{"files":{"readme":"README.ja.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-29T02:15:32.000Z","updated_at":"2024-12-28T03:59:27.000Z","dependencies_parsed_at":"2024-12-23T07:30:58.453Z","dependency_job_id":null,"html_url":"https://github.com/kinto-technologies/SpringBoot3BatchStarter","commit_stats":null,"previous_names":["kinto-technologies/springboot3batchstarter"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinto-technologies%2FSpringBoot3BatchStarter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinto-technologies%2FSpringBoot3BatchStarter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinto-technologies%2FSpringBoot3BatchStarter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinto-technologies%2FSpringBoot3BatchStarter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kinto-technologies","download_url":"https://codeload.github.com/kinto-technologies/SpringBoot3BatchStarter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239402915,"owners_count":19632478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chunk","ci-cd","csv","data-integration","database-migration","datasource","docker","github-actions","h2","java","job-configuration","jooq","multi-database","mysql","opencsv","skeleton-code","spring-batch-5","spring-boot-3","spring-framework","tasklet"],"created_at":"2024-12-27T02:13:44.503Z","updated_at":"2025-11-02T23:30:27.266Z","avatar_url":"https://github.com/kinto-technologies.png","language":"Java","readme":"# Spring Batch 5 Starter\n\n**コピペで即完成! Spring Batch 5** 🚀\n\n[![GitHub stars](https://img.shields.io/github/stars/kinto-technologies/SpringBoot3BatchStarter?style=social)](https://github.com/kinto-technologies/SpringBoot3BatchStarter/stargazers)\n[![Build](https://github.com/kinto-technologies/SpringBoot3BatchStarter/actions/workflows/build.yml/badge.svg)](https://github.com/kinto-technologies/SpringBoot3BatchStarter/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/kinto-technologies/SpringBoot3BatchStarter/branch/main/graph/badge.svg)](https://codecov.io/gh/kinto-technologies/SpringBoot3BatchStarter)\n![Java 21](https://img.shields.io/badge/Java-21%2B-blue)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-CC2233.svg)](https://opensource.org/licenses/Apache-2.0)\n\n🇬🇧 英語版のREADMEは[こちら](README.md)\n\n## 📋 前提条件\n* JDK 21（Gradleのツールチェーンで自動ダウンロード）\n* Docker Desktop\n* Gradle 8.5+（gradlewを使用する場合は不要）\n\n\u003e 💡 JDK 21が必要ですが、Gradleのツールチェーン機能により、ローカルにインストールされていなくても自動的にダウンロードされます。\n\n## 🔍 概要\n\nこのスターターキットは、Spring Boot 3とSpring Batch 5向けに特別に設計され、エンタープライズバッチ処理アプリケーションのための本番稼働可能な基盤を提供します。主に2つのコンポーネントで構成されています：\n\n### スケルトンバッチ\nすぐに使える最小限のバッチアプリケーションで、以下が可能です：\n\n- 業務ロジックを追加するだけで開発開始\n- 複雑な設定なしで実装に集中\n- H2インメモリデータベースで任意の環境で実行可能\n\n### DBとCSVのバッチ\n一般的なバッチ処理を実装した実用的な例：\n\n- カスタマイズ可能なクエリによるDBからCSVへのデータ出力\n- 効率的なバルク操作によるCSVからDBへのデータ登録\n- マルチデータベース構成のベストプラクティスを実演\n\n両コンポーネントは業界のベストプラクティスに基づいて構築され、最新のSpringフレームワーク機能を活用してバッチ開発プロセスを加速します。\n\n## 🚀 クイックスタート\n\n### 1️⃣ スケルトンバッチを試す\n```bash\n# リポジトリのクローン\ngit clone https://github.com/kinto-technologies/SpringBoot3BatchStarter.git\n\n# スケルトンバッチの実行\n./gradlew :skeletonBatch:bootRun\n```\n\n### 2️⃣ DBとCSVのバッチを試す\n\n```bash\n# MySQL 起動\ndocker compose up -d\n\n# DB to CSV 実行\n./gradlew :dbAndCsvBatch:bootRun --args=\"--spring.batch.job.name=DB_TO_CSV --spring.profiles.active=local\"\n\n# CSV to DB 実行\n./gradlew :dbAndCsvBatch:bootRun --args=\"--spring.batch.job.name=CSV_TO_DB --spring.profiles.active=local\"\n```\n\n---\n\n## 📁 プロジェクト構造\n```text\n.\n├── gradlew                # Gradleラッパー\n├── settings.gradle\n├── compose.yaml           # Docker Compose設定\n├── init-scripts           # DB初期化スクリプト\n│   ├── 1-create-table.sql\n│   └── 2-insert-data.sql\n├── dbAndCsvBatch          # DB-CSVバッチ\n│   ├── README.md\n│   ├── build.gradle\n│   └── src/\n└── skeletonBatch          # スケルトンバッチ\n    ├── README.md\n    ├── build.gradle\n    └── src/\n```\n\n## 💡 主な機能\n\n### 🏗️ 基盤機能\n- **本番稼働可能なバッチフレームワーク**：\n    - すぐに開発を始められる構成\n    - 必要最小限の設定で動作\n    - H2インメモリDBによる簡単セットアップ\n\n### 🔄 データ操作\n- **DB→CSV出力**：\n    - 動的クエリのサポート\n    - 柔軟なデータ抽出設定\n- **CSV→DB登録**：\n    - バルク操作による一括登録\n    - 高性能なデータローディング\n\n### 🛠️ 技術スタック\n- **Spring連携**：\n    - Spring Batchによるジョブ/ステップ管理\n    - jOOQによる型安全なSQL実行\n    - OpenCSVによるCSV処理\n- **デュアルデータベース設定**：\n    - バッチ管理用H2インメモリDB\n    - 業務データ用MySQL\n\n### 💻 開発者向け機能\n- **動的設定**：\n    - 環境別プロファイル（local/server）\n    - 実行時設定可能なジョブ実行\n    - クエリのカスタマイズ対応\n\n### 🔍 品質管理\n- Google Java Format（Spotless）\n- 静的解析（SpotBugs）\n- テストカバレッジ（Jacoco）\n- GitHub Actions CIパイプライン\n\n## 📌 バージョン情報\n* Spring Boot: 3.4.1\n* Spring Dependency Management: 1.1.7\n* Spotless (Google Java Format): 6.22.0\n* jOOQ: 9.0\n* OpenCSV: 5.9\n* SpotBugs: 6.0.27\n\n## ❓ よくある問題と解決方法\n\n### Entityクラスが見つからない\n- **原因**：jOOQの自動生成が未実行\n- **解決**：`../gradlew generateJooq` を実行\n- **または**：`build/generated-src/jooq` を `src/main/java` にコピー\n\n### データベース接続エラー\n- **原因**：MySQLコンテナが未起動\n- **解決**：`docker compose up -d` を実行\n- **確認**：`docker ps` でコンテナの状態を確認\n\n### 複数ジョブ存在エラー\n- **症状**：「Job name must be specified」エラー\n- **原因**：実行するジョブ名の指定が必要\n- **解決**：`--spring.batch.job.name=DB_TO_CSV` を指定\n\n## 🔄 継続的インテグレーション\n\nこのプロジェクトでは以下のCI/CDツールを活用しています：\n\n### GitHub Actions\n- 自動ビルドとテスト\n- コードフォーマットチェック（Google Java Format）\n- 静的解析（SpotBugs）\n- テストカバレッジ計測（Jacoco）\n\n### Codecov\n- テストカバレッジの可視化\n- プルリクエスト時のカバレッジレポート自動生成\n- カバレッジ変更の追跡\n\n### MySQL CI環境\n- GitHub Actionsでの自動セットアップ\n- テスト用データベースの構築\n- jOOQによるエンティティ自動生成の検証\n\n### ワークフロー\n1. プッシュまたはプルリクエスト時に自動実行\n2. MySQLコンテナのセットアップ\n3. JDK 21環境の構築\n4. Gradleによるビルドとテスト\n5. カバレッジレポートの生成とアップロード\n\n## 📄 ライセンス\n**[Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)**\n\nCopyright © 2024 KINTO Technologies Corporation","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinto-technologies%2Fspringboot3batchstarter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkinto-technologies%2Fspringboot3batchstarter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinto-technologies%2Fspringboot3batchstarter/lists"}