{"id":45345190,"url":"https://github.com/rieske/java-service-gradle-plugins","last_synced_at":"2026-02-21T11:07:32.565Z","repository":{"id":53836538,"uuid":"521594237","full_name":"rieske/java-service-gradle-plugins","owner":"rieske","description":"An opinionated plugin for building, testing and packaging Java services","archived":false,"fork":false,"pushed_at":"2026-01-23T18:19:24.000Z","size":495,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-24T08:35:37.146Z","etag":null,"topics":["docker","gradle","gradle-plugin","java","microservices","microservices-testing","services"],"latest_commit_sha":null,"homepage":"","language":"Groovy","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/rieske.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-08-05T10:21:37.000Z","updated_at":"2026-01-23T18:18:19.000Z","dependencies_parsed_at":"2023-11-11T08:24:10.792Z","dependency_job_id":"1f60d304-51d6-4e66-bc7d-224c5dbb63c4","html_url":"https://github.com/rieske/java-service-gradle-plugins","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rieske/java-service-gradle-plugins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rieske%2Fjava-service-gradle-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rieske%2Fjava-service-gradle-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rieske%2Fjava-service-gradle-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rieske%2Fjava-service-gradle-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rieske","download_url":"https://codeload.github.com/rieske/java-service-gradle-plugins/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rieske%2Fjava-service-gradle-plugins/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29679137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T09:33:50.764Z","status":"ssl_error","status_checked_at":"2026-02-21T09:33:19.949Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["docker","gradle","gradle-plugin","java","microservices","microservices-testing","services"],"created_at":"2026-02-21T11:07:32.066Z","updated_at":"2026-02-21T11:07:32.560Z","avatar_url":"https://github.com/rieske.png","language":"Groovy","readme":"# Gradle plugins for building Java services\n\n[![Actions Status](https://github.com/rieske/java-service-gradle-plugins/workflows/master/badge.svg)](https://github.com/rieske/java-service-gradle-plugins/actions/workflows/master.yml)\n[![Gradle Plugin Portal](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/io/github/rieske/java-service-gradle-plugins/plugins/maven-metadata.xml.svg?colorB=007ec6\u0026label=Plugin%20Portal)](https://plugins.gradle.org/plugin/io.github.rieske.java-service)\n\n## io.github.rieske.java-service\n\n### Requirements\n\nRequires at least:\n- Java 11\n- Gradle 7.3 (the plugin uses the [JVM Test Suite Plugin](https://docs.gradle.org/current/userguide/jvm_test_suite_plugin.html))\n\n### Description\n\nAn opinionated plugin for building and testing a Java service:\n- Compile and unit test the components as usual\n- Package the application using Gradle's core `application` plugin.\nMight play with Spring and such as well, but I'm not a fan of all that heavyweight magic -\njust pick a library for a server, a library for JDBC or whatever, a library for something else, assemble everything in main() and be good to go.\n- Package the service for deployment in a docker image\n- [Black box test](https://github.com/rieske/black-box-testing) the produced docker image - unit testing the bits and pieces is not enough - the artifact has to be tested when it is fully assembled as well.\nFar too often I have seen services with high unit test coverage percentage fail to even start up when assembled for deployment.\n\nConfigures a reproducible build that packages the Java application (using Gradle's core `application` plugin)\nin a tar file and configures the [`docker`](https://github.com/bmuschko/gradle-docker-plugin) plugin for further\npackaging of the built artifact into a docker image.\nThe resulting docker image will be tagged with `${rootProject.name}:snapshot` and you can then\nretag it after the build and push it to some docker registry for deployment.\nThe `rootProject.name` is configured in the `settings.gradle` file (and yes, this makes an\nassumption of one service per project build (and hopefully per repository too!)).\n\nThe Dockerfile should be provided by the user - there are no assumptions made about how the base\nimage should be configured.\nThe easiest way to package the built application is to extract the built tar file and set the entrypoint like this:\n```Dockerfile\n# FROM directive and other base image setup goes here\nENV SERVICE_NAME=my-service\nENTRYPOINT /opt/service/$SERVICE_NAME/bin/$SERVICE_NAME\nADD $SERVICE_NAME.tar /opt/service/\n```\n\nConfigures `blackBoxTest` source set that depends on the service's docker image.\nThis allows to test the produced artifact before it is published/deployed.\nThe `blackBoxTest` task is configured to be rerun only on production artifact (docker image), and\nthe `blackBoxTest` source set changes.\n\nUsage:\n```groovy\nplugins {\n    id(\"io.github.rieske.java-service\").version(\"1.0.0\")\n}\n\njava {\n    // Configure the Java extension as usual\n    toolchain {\n        languageVersion = JavaLanguageVersion.of(17)\n    }\n}\n\napplication {\n    // Specify the class with the main method as usual with the application plugin\n    mainClass = \"com.example.Main\"\n}\n\ndependencies {\n    // implementation(\"...\")\n    // testImplementation(\"...\")\n\n    // black box test implementation configuration does not depend on implementation or testImplementation\n    // You will most likely want JUnit and testcontainers dependencies here for starters\n    // blackBoxTestImplementation(\"...\")\n}\n```\n\nAnd add a `Dockerfile` in the root of the subproject where this plugin is applied.\nNote, the `my-service.tar` contains the applicatoin bundled using the `application` plugin and it\nwill be put in the Docker's context for the build.\n\nFor example:\n```Dockerfile\nFROM eclipse-temurin:17-jre\nEXPOSE 8080\n# Shouldn't need any more than this if not going for something heavyweight like Spring\nENV JAVA_OPTS -Xmx64m -Xms64m\n\n# my-service is the name of the subproject where the plugin is applied\nENV SERVICE_NAME=my-service\nENTRYPOINT /opt/service/$SERVICE_NAME/bin/$SERVICE_NAME\n# add the service archive last thing to utilize docker layer caching\nADD $SERVICE_NAME.tar /opt/service/\n```\n\nTo build the service, use `./gradlew build` as usual. This will:\n- compile the sources\n- run the unit tests from the `test` source set\n- build the docker image using the configured `docker` task\n- run the `blackBoxTest` task using the sources in `blackBoxTest` source set\n\nThe plugin is also compatible with Gradle's [Configuration cache](https://docs.gradle.org/current/userguide/configuration_cache.html)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frieske%2Fjava-service-gradle-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frieske%2Fjava-service-gradle-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frieske%2Fjava-service-gradle-plugins/lists"}