{"id":19238139,"url":"https://github.com/cloud-design-patterns-journey/template-java-spring","last_synced_at":"2026-05-18T07:31:49.921Z","repository":{"id":234716093,"uuid":"788905005","full_name":"cloud-design-patterns-journey/template-java-spring","owner":"cloud-design-patterns-journey","description":"Starting point for creating Java microservice applications running on Spring.","archived":false,"fork":false,"pushed_at":"2025-05-20T13:45:45.000Z","size":130,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-20T14:41:06.998Z","etag":null,"topics":["java","spring","starter-kit","tekton"],"latest_commit_sha":null,"homepage":"","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/cloud-design-patterns-journey.png","metadata":{"files":{"readme":"README.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-04-19T10:13:31.000Z","updated_at":"2025-05-20T13:45:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"feadb2fb-5989-4368-a85d-25aaa3c1994e","html_url":"https://github.com/cloud-design-patterns-journey/template-java-spring","commit_stats":null,"previous_names":["cloud-design-patterns-journey/template-java-spring"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/cloud-design-patterns-journey/template-java-spring","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-design-patterns-journey%2Ftemplate-java-spring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-design-patterns-journey%2Ftemplate-java-spring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-design-patterns-journey%2Ftemplate-java-spring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-design-patterns-journey%2Ftemplate-java-spring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloud-design-patterns-journey","download_url":"https://codeload.github.com/cloud-design-patterns-journey/template-java-spring/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-design-patterns-journey%2Ftemplate-java-spring/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33169193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["java","spring","starter-kit","tekton"],"created_at":"2024-11-09T16:29:30.682Z","updated_at":"2026-05-18T07:31:49.882Z","avatar_url":"https://github.com/cloud-design-patterns-journey.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Spring microservice starter kit\n\nThis repo provides a starting point for creating Java microservice applications running on [Spring](https://spring.io/).\nIt contains a simple Hello World application as an example of how to get started, as well as a number of standard features.\n\nThe port defaults to `8080` and can be updated in `application.yaml` or overridden as environment variables.\n\n## Getting started\n\nAfter creating a repository from the template, make the following updates:\n\n1. Change the application name in \"settings.gradle\"\n2. Update the `NAME`, `SUMMARY`, `DESCRIPTION`, and `VENDOR` default values in \"Dockerfile\"\n3. Update the `name` value for the chart in \"chart/hello-watson/Chart.yaml\"\n4. Change the directory name of the helm chart to match the value in \"chart/hello-watson/Chart.yaml\"\n\n## Features\n\n### Health endpoint\n\nA simple health endpoint is provided for use in the readiness and liveness probes. The\nendpoint simply returns `{\"response\": \"OK\"}` when called. As long as the Spring server\nis running, this endpoint should work.\n\n### OpenApi 3.0 config\n\nThe SpringDoc module has been added to give support for OpenApi 3 configuration. This is\nexposed in a couple of ways:\n\n- Swagger UI - the swagger ui can be access from `/swagger-ui.html` to allow access to the api\n- OpenApi spec - the JSON OpenApi spec can be accessed from `/v3/api-docs` and the yaml version from `/v3/api-docs.yaml`\n\nThe configuration for the OpenApi spec comes from a combination of the `OpenApiConfiguration` object and\nannotations provided on the individual endpoints. Any endpoint or RestController can be excluded from the\napi spec generation by adding the `@Hidden` annotation.\n\n### Dockerfile (springboot fat jar)\n\nThe Dockerfile file contains a multistage container build process to package the fat spring jar in a builder\nstage and bundle the jar into an executable java runtime image. Both the builder and runtime images are based\non UBI9 images.\n\n## Configuration\n\nThe following configuration values are available for development-time configuration of default values (`application.yaml`)\nand/or runtime configuration values that can be provided as environment variables.\n\n| Description                | application.yaml    | Env var         |\n|----------------------------|---------------------|-----------------|\n| Port the server listens on | server.port         | PORT            |\n| Id of the api              | openapi.id          | API_ID          |\n| Title of the api           | openapi.title       | API_TITLE       |\n| Description of the api     | openapi.description | API_DESCRIPTION |\n\n\n## Development\n\n### Open Api documentation\n\nThere are a number of ways to customize the Open API spec that is generated from the application code.\n\n#### Spec configuration\n\nThe configuration for the general elements of the Open API spec are provided in the `OpenApiConfiguration` object.\nValues for the spec are pulled from the `application.yaml` file and can be overridden by environment variables at\ndeployment time. Currently, the configuration provided in the OpenApiConfiguration covers the basic values. It can be extended and\ncustomized for specific requirements.\n\nThe Open API configuration is provided in a Java object with a number of attributes. Many of the values will be generated\nfrom the annotations on the endpoints and entities.\n\n#### Endpoint annotations\n\nAn individual endpoint methods within the RestController can be annotated using the `@Operation` annotation. For example,\nadding a summary, documenting parameters, and adding extensions would look like the following:\n\n```java\n@RestController\npublic class HelloWatsonController {\n    @GetMapping(value = \"/hello/{name}\", produces = {MediaType.APPLICATION_JSON_VALUE})\n    @Operation(\n            summary = \"Say hello to someone\",\n            parameters = {\n                    @Parameter(\n                            name = \"name\",\n                            description = \"Name of person to greet\",\n                            extensions = @Extension(properties = {@ExtensionProperty(name = \"x-ibm-label\", value = \"Name\")})\n                    )\n            }\n    )\n    public SimpleResponse\u003cString\u003e helloName(@PathVariable(\"name\") String name) {\n        return new SimpleResponse\u003c\u003e(String.format(\"Hello, %s!\", name));\n    }\n}\n```\n\nThe operation annotation supports a number of attributes. See [Operation docs](https://docs.swagger.io/swagger-core/v2.0.0-RC3/apidocs/io/swagger/v3/oas/annotations/Operation.html) for more details.\n\n#### Entity annotations\n\nThe API documentation for entity schemas can be manipulated using the `@Schema` annotation\non individual fields. For example, adding a description and extension to a property of an entity would look like the following:\n\n```java\npublic class MyEntity {\n    @Schema(\n            description = \"Employee ID\",\n            extensions = @Extension(properties = {\n                    @ExtensionProperty(name = \"x-ibm-disable\", value = \"true\")\n            })\n    )\n    private String employeeId;\n}\n```\n\nThe schema annotation supports a number of attributes. See [Schema docs](https://docs.swagger.io/swagger-core/v2.0.0-RC3/apidocs/io/swagger/v3/oas/annotations/media/Schema.html) for more details.\n\n### Gradle\n\nGradle has been selected as the build tool. The Gradle dependencies are included in the repository and can be\naccess via the `gradlew`/`gradlew.bat` script which will work so long as Java is available. Here are some basic\ncommands for development:\n\n- `./gradlew clean` - clean previous build outputs\n- `./gradlew build` - compile Java source\n- `./gradlew test` - execute unit tests\n- `./gradlew package` - build the jar/war package file\n- `./gradlew bootRun` - run the executable application components in a hot-swappable development environment\n\n### OCI\n\nA Dockerfile is provided to build a container image for running the application. The container image definition\ncontains default ARG values used for labels in the built container image. The values can be updated in the Dockerfile\nand/or provided at build time by using the `--build-arg` flag.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloud-design-patterns-journey%2Ftemplate-java-spring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloud-design-patterns-journey%2Ftemplate-java-spring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloud-design-patterns-journey%2Ftemplate-java-spring/lists"}