{"id":19208609,"url":"https://github.com/heiwa4126/springboot-cmdline-hello1","last_synced_at":"2025-11-14T03:02:34.338Z","repository":{"id":111911562,"uuid":"412358196","full_name":"heiwa4126/springboot-cmdline-hello1","owner":"heiwa4126","description":"Spring Bootでコマンドラインアプリのサンプル。加えてプロファイル切替の実験。","archived":false,"fork":false,"pushed_at":"2021-10-01T07:39:56.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T07:16:28.942Z","etag":null,"topics":["cli","example","springboot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heiwa4126.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-10-01T06:43:11.000Z","updated_at":"2021-10-01T07:39:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"1801945b-ff44-4400-af6d-26392ca73c2e","html_url":"https://github.com/heiwa4126/springboot-cmdline-hello1","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/heiwa4126/springboot-cmdline-hello1","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiwa4126%2Fspringboot-cmdline-hello1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiwa4126%2Fspringboot-cmdline-hello1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiwa4126%2Fspringboot-cmdline-hello1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiwa4126%2Fspringboot-cmdline-hello1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heiwa4126","download_url":"https://codeload.github.com/heiwa4126/springboot-cmdline-hello1/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiwa4126%2Fspringboot-cmdline-hello1/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284327703,"owners_count":26985957,"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","status":"online","status_checked_at":"2025-11-14T02:00:06.101Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cli","example","springboot"],"created_at":"2024-11-09T13:27:10.906Z","updated_at":"2025-11-14T03:02:34.282Z","avatar_url":"https://github.com/heiwa4126.png","language":"Java","readme":"# springboot-cmdline-hello1\n\nSpring Bootでコマンドラインアプリのサンプル。加えてプロファイル切替の実験\n\n# 使い方\n\n```sh\n./gradlw bootJar\n```\nで `build/libs/hello1-0.0.1-SNAPSHOT.jar` にFat JARができるので、\n以下のように試す。\n(GitHubのreleasesにもjar置いときます)\n\n内蔵のプロファイルはdev(default)とprod\n\n```sh\njava -jar build/libs/hello1-0.0.1-SNAPSHOT.jar test1 test2\njava -Dspring.profiles.active=prod -jar build/libs/hello1-0.0.1-SNAPSHOT.jar test3 test4\nSPRING_PROFILES_ACTIVE=prod java -jar build/libs/hello1-0.0.1-SNAPSHOT.jar test5 test6\njava -jar build/libs/hello1-0.0.1-SNAPSHOT.jar test7 test8 --spring.profiles.active=prod\njava -Dtest.msg=xxxx -jar hello1-0.0.1-SNAPSHOT.jar\n```\n\n- 存在しないプロファイルを指定するとどうなるか? \n- 環境変数とオプションで異なるプロファイルを指定するとどうなるか? \n  \nとかも試してみて。\n\n\n# 参考\n\n- [7\\.3\\. Profiles](https://docs.spring.io/spring-boot/docs/2.5.5/reference/htmlsingle/#features.profiles)\n- [12\\.2\\.6\\. Set the Active Spring Profiles](https://docs.spring.io/spring-boot/docs/2.5.5/reference/htmlsingle/#features.profiles)\n- [7\\.3\\. プロファイル](https://spring.pleiades.io/spring-boot/docs/2.5.4/reference/htmlsingle/#features.profiles) - 日本語\n- [12\\.2\\.6\\. アクティブ Spring プロファイルを設定する](https://spring.pleiades.io/spring-boot/docs/2.5.4/reference/htmlsingle/#features.profiles) - 日本語\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheiwa4126%2Fspringboot-cmdline-hello1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheiwa4126%2Fspringboot-cmdline-hello1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheiwa4126%2Fspringboot-cmdline-hello1/lists"}