{"id":21633745,"url":"https://github.com/dgroomes/gradle-playground","last_synced_at":"2026-05-17T20:01:52.072Z","repository":{"id":51626734,"uuid":"247615923","full_name":"dgroomes/gradle-playground","owner":"dgroomes","description":"📚 Learning and exploring Gradle (the Java build tool)","archived":false,"fork":false,"pushed_at":"2026-04-25T22:26:33.000Z","size":421,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-26T00:32:55.658Z","etag":null,"topics":["gradle","java","java-records","java14"],"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/dgroomes.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":"2020-03-16T05:10:34.000Z","updated_at":"2026-04-25T22:26:38.000Z","dependencies_parsed_at":"2024-08-03T17:25:34.676Z","dependency_job_id":"51d72405-d900-4d93-a357-cec99d2a739a","html_url":"https://github.com/dgroomes/gradle-playground","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dgroomes/gradle-playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroomes%2Fgradle-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroomes%2Fgradle-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroomes%2Fgradle-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroomes%2Fgradle-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgroomes","download_url":"https://codeload.github.com/dgroomes/gradle-playground/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroomes%2Fgradle-playground/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33153662,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["gradle","java","java-records","java14"],"created_at":"2024-11-25T03:13:40.092Z","updated_at":"2026-05-17T20:01:52.065Z","avatar_url":"https://github.com/dgroomes.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gradle-playground\n\n📚 Learning and exploring the Gradle Build Tool.\n\n\u003e Gradle is the open source build system of choice for Java, Android, and Kotlin developers. From mobile apps to microservices, from small startups to big enterprises, it helps teams deliver better software, faster.\n\u003e -- \u003ccite\u003ehttps://gradle.org\u003c/cite\u003e\n\n\n## Why is this useful?\n\nGradle can be complex to configure correctly because it is a powerful DSL with a rich set of features and plugins. It's\nhard to remember the exact incantations to write in a `build.gradle.kts` to\nconfigure, for example, the enablement of Java language preview features or JUnit test logging.\n\nWhile all the information you need to configure a Gradle project is technically available in the highly thorough and\naccurate [official Gradle documentation](https://docs.gradle.org/current/userguide/userguide.html) and embedded in\n[executable sample projects within the Gradle source code repository](https://github.com/gradle/gradle/tree/master/platforms/documentation/docs/src/snippets),\nthis repository contains my own personal examples that I need to refer back to continuously in my day-to-day development.\nIn other words, this repository whittles down the full scale of Gradle to a few files for my own quick reference.\n\n\n## Standalone subprojects\n\nThis repository illustrates different concepts, patterns and examples via standalone subprojects. Each subproject is\ncompletely independent of the others and do not depend on the root project. This _standalone subproject constraint_\nforces the subprojects to be complete and maximizes the reader's chances of successfully running, understanding, and\nre-using the code.\n\nThe subprojects include:\n\n\n### `java-preview-features/`\n\nConfigure Gradle to build and run a project that uses Java [_Preview Features_](https://openjdk.java.net/jeps/12).\n\nSee the README in [java-preview-features/](java-preview-features/).\n\n\n### `java-early-access-via-toolchain/`\n\nThis subproject illustrates how to leverage Gradle's [Toolchains for JVM projects](https://docs.gradle.org/current/userguide/toolchains.html)\nto use an early-access version of Java in a Gradle project.\n\nSee the README in [java-early-access-via-toolchain/](java-early-access-via-toolchain/).\n\n\n### `consuming-a-maven-bom/`\n\nConsume a Maven BOM in a Gradle project and *strictly* override a BOM dependency.\n\nSee the README in [consuming-a-maven-bom/](consuming-a-maven-bom/).\n\n\n### `pre-compiled-script-plugin/`\n\nUsing a *pre-compiled script plugin* to apply common conventions to Gradle subprojects.\n\nSee the README in [pre-compiled-script-plugin/](pre-compiled-script-plugin/).\n\n\n### `multi-project-cross-configuration/`\n\nA multi-project Gradle build configured with cross-project configuration using the `allprojects` and `subprojects` DSL constructs.\n\nSee the README in [multi-project-cross-configuration/](multi-project-cross-configuration/).\n\n\n### `plugin/`\n\nWrite and apply a custom Gradle plugin. This project also showcases [Gradle's `buildSrc` feature](https://docs.gradle.org/current/userguide/organizing_gradle_projects.html#sec:build_sources).\n\nSee the README in [plugin/](plugin/).\n\n\n### `java-modules/`\n\nAn example Gradle project that uses the Java Platform Module System (JPMS).\n\nSee the README in [java-modules/](java-modules/).\n\n\n## Wish List\n\nGeneral clean-ups, changes and things I wish to implement for this project:\n\n* [x] DONE Revive `java-toolchain` and upgrade it to Java 20 (because Java 18 I can't download easily so I'm going to just\n  unload this subproject from the `settings.gradle.kts` file for now)\n* [x] DONE Updates for 2023.\n* [x] DONE Implement a `java-preview-features-kotlin-dsl` subproject. (Pretty much copy \u003chttps://github.com/dgroomes/wiremock-playground/blob/db2684af8617995106e7793ea1348e1d6516bc70/build.gradle.kts\u003e)   \n* [x] DONE `java-preview-features` to `java-preview-features-groovy-dsl` and `java-preview-features-kotlin-dsl` to `java-preview-features`\n   because the Kotlin DSL is now fully usable and featureful in my experience. This was not quite true a year ago but it\n   is really good now! I love the auto-completion.\n* [x] DONE Add a multi-module Gradle project example. Similar to the one defined at \u003chttps://github.com/dgroomes/kafka-playground/blob/557243bea2960a18e5b11da04f2cec46989576ee/build.gradle.kts#L10\u003e \n* [x] DONE Add a subproject that showcases `buildSrc/`\n* [x] DONE Remove `mavenLocal()`. Great official explanation in the [Gradle docs](https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:case-for-maven-local)\n* [x] DONE Upgrade to Gradle 6.8.1 (when it comes out)\n* [x] DONE Build in GitHub Actions\n* [ ] Can we get both Java 15 and Java 16 in the GitHub Actions build environment? If we could, then we can include the 'java-toolchain/'\n   subproject to the 'assembleAll' Gradle task.\n* [ ] Incorporate Gradle's [test fixtures](https://docs.gradle.org/current/userguide/java_testing.html#sec:java_test_fixtures)\n   feature in one of the subprojects\n* [x] DONE (I implemented something in `scratch`. I couldn't figure out the architecture though. I think it creates a new classloader and loads the jars from the download Gradle distros) Consider exploring [Gradle's Tooling API](https://docs.gradle.org/current/userguide/third_party_integration.html#embedding) for programmatic access to Gradle. I don't know if I'll ever have a use-case for this,\n  but I won't know until I learn it.\n  * This note caught my eye. How does this work?\n  * \u003e A fundamental characteristic of the Tooling API is that it operates in a version independent way. This means that\n    \u003e you can use the same API to work with builds that use different versions of Gradle, including versions that are\n    \u003e newer or older than the version of the Tooling API that you are using. The Tooling API is Gradle wrapper aware\n    \u003e and, by default, uses the same Gradle version as that used by the wrapper-powered build.\n* [x] DONE `pre-compiled-script-plugin` subproject\n  * I use pre-compiled script plugins somewhat often. They are a natural thing to reach for in a multi-module Gradle project. I find myself wanting them as soon as I have to repeat the junit/testing config stanza more than twice. That said, they aren't perfect, especially because of some restrictions that make the ergonomics worse, when paired with version catalogs. See [Gradle GH issue #15383: *Make generated type-safe version catalogs accessors accessible from precompiled script plugins*](https://github.com/gradle/gradle/issues/15383#issuecomment-779893192). That leads you to using a work-around that escalates the complexity to a point where I have a hard time recommending the pattern for a typical team of software engineers. I have gone back and forth on this so many times. I need to at least lock in an example, complete with generous links and explanation and a characterization of the trade-offs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgroomes%2Fgradle-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgroomes%2Fgradle-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgroomes%2Fgradle-playground/lists"}