{"id":25720116,"url":"https://github.com/gregwhitaker/gradle-monorepo-example","last_synced_at":"2025-05-06T19:45:21.126Z","repository":{"id":82732542,"uuid":"170001853","full_name":"gregwhitaker/gradle-monorepo-example","owner":"gregwhitaker","description":"Example of building projects in a monorepo using Gradle Composite Builds","archived":false,"fork":false,"pushed_at":"2022-12-07T01:06:55.000Z","size":233,"stargazers_count":30,"open_issues_count":1,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T02:21:31.862Z","etag":null,"topics":["gradle","gradle-build","gradle-compositebuild","gradle-java","monorepo"],"latest_commit_sha":null,"homepage":"https://docs.gradle.org/current/userguide/composite_builds.html","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gregwhitaker.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":"2019-02-10T16:56:57.000Z","updated_at":"2024-11-19T19:36:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"b463780b-048c-4aa7-86bf-c84a884b66fc","html_url":"https://github.com/gregwhitaker/gradle-monorepo-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fgradle-monorepo-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fgradle-monorepo-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fgradle-monorepo-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fgradle-monorepo-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregwhitaker","download_url":"https://codeload.github.com/gregwhitaker/gradle-monorepo-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252756596,"owners_count":21799509,"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":["gradle","gradle-build","gradle-compositebuild","gradle-java","monorepo"],"created_at":"2025-02-25T17:36:35.621Z","updated_at":"2025-05-06T19:45:21.116Z","avatar_url":"https://github.com/gregwhitaker.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gradle-monorepo-example\n\nAn example of building projects in a monorepo using [Gradle Composite Builds](https://docs.gradle.org/current/userguide/composite_builds.html).\n\n## Repository Structure\nThe repository contains four projects each with their own Gradle configurations.\n\nProjects A, B, and C have dependencies on one another:\n\n    [project-a] -- DEPENDS --\u003e [project-b] -- DEPENDS --\u003e [project-c]\n    \nProject D has no dependencies on the other projects:\n    \n    [project-d]\n\n## Running the Example\nFollow the steps below to run the example:\n\n### Build Project A\nRun the following commands to build [project-a](project-a):\n\n1. Change the working directory to [project-a](project-a):\n\n        cd project-a\n        \n2. Run the following command to generate classes for the project:\n\n        ./gradlew classes --info\n        \n    Notice in the command output that [project-b](project-b) and [project-c](project-c) was also configured and built, \n    but [project-d](project-d) was neither configured nor built:\n\n        \u003e Configure project :project-b\n        Evaluating project ':project-b' using build file '/Users/greg/workspace/gradle-compositebuild-example/project-b/build.gradle'.\n        Registering project ':project-b' in composite build. Will substitute for module 'example.gcb.gregwhitaker:project-b'.\n        [composite-build] Configuring build: /Users/greg/workspace/gradle-compositebuild-example/project-c\n        \n        \u003e Configure project :project-c\n        Evaluating project ':project-c' using build file '/Users/greg/workspace/gradle-compositebuild-example/project-c/build.gradle'.\n        Registering project ':project-c' in composite build. Will substitute for module 'example.gcb.gregwhitaker:project-c'.\n        \n        \u003e Configure project :\n        Evaluating root project 'project-a' using build file '/Users/greg/workspace/gradle-compositebuild-example/project-a/build.gradle'.\n        All projects evaluated.\n        Selected primary task 'classes' from project :\n        Found project 'project :project-b' as substitute for module 'example.gcb.gregwhitaker:project-b'.\n        Selected primary task ':jar' from project :\n        Found project 'project :project-c' as substitute for module 'example.gcb.gregwhitaker:project-c'.\n        Selected primary task ':jar' from project :\n        Executing project-b tasks [:jar]\n        Executing project-c tasks [:jar]\n        Tasks to be executed: [task ':compileJava', task ':processResources', task ':classes']\n        :project-b:processResources (Thread[Task worker for ':project-b',5,main]) started.\n        :project-c:compileJava (Thread[Task worker for ':project-c' Thread 3,5,main]) started.\n        :processResources (Thread[Task worker for ':' Thread 4,5,main]) started.\n        \n        \u003e Task :project-b:processResources NO-SOURCE\n        Skipping task ':project-b:processResources' as it has no source files and no previous output files.\n        :project-b:processResources (Thread[Task worker for ':project-b',5,main]) completed. Took 0.005 secs.\n        \n        \u003e Task :processResources NO-SOURCE\n        Skipping task ':processResources' as it has no source files and no previous output files.\n        :processResources (Thread[Task worker for ':' Thread 4,5,main]) completed. Took 0.004 secs.\n        \n        \u003e Task :project-c:compileJava UP-TO-DATE\n        Skipping task ':project-c:compileJava' as it is up-to-date.\n        :project-c:compileJava (Thread[Task worker for ':project-c' Thread 3,5,main]) completed. Took 0.007 secs.\n        :project-c:processResources (Thread[Task worker for ':project-c' Thread 3,5,main]) started.\n        \n        \u003e Task :project-c:processResources NO-SOURCE\n        Skipping task ':project-c:processResources' as it has no source files and no previous output files.\n        :project-c:processResources (Thread[Task worker for ':project-c' Thread 3,5,main]) completed. Took 0.0 secs.\n        :project-c:classes (Thread[Task worker for ':project-c' Thread 3,5,main]) started.\n        \n        \u003e Task :project-c:classes UP-TO-DATE\n        Skipping task ':project-c:classes' as it has no actions.\n        :project-c:classes (Thread[Task worker for ':project-c' Thread 3,5,main]) completed. Took 0.0 secs.\n        :project-c:jar (Thread[Task worker for ':project-c' Thread 3,5,main]) started.\n        \n        \u003e Task :project-c:jar UP-TO-DATE\n        Skipping task ':project-c:jar' as it is up-to-date.\n        :project-c:jar (Thread[Task worker for ':project-c' Thread 3,5,main]) completed. Took 0.002 secs.\n        :project-b:compileJava (Thread[Task worker for ':project-b' Thread 2,5,main]) started.\n        \n        \u003e Task :project-b:compileJava UP-TO-DATE\n        Skipping task ':project-b:compileJava' as it is up-to-date.\n        :project-b:compileJava (Thread[Task worker for ':project-b' Thread 2,5,main]) completed. Took 0.005 secs.\n        :project-b:classes (Thread[Task worker for ':project-b' Thread 2,5,main]) started.\n        \n        \u003e Task :project-b:classes UP-TO-DATE\n        Skipping task ':project-b:classes' as it has no actions.\n        :project-b:classes (Thread[Task worker for ':project-b' Thread 2,5,main]) completed. Took 0.0 secs.\n        :project-b:jar (Thread[Task worker for ':project-b' Thread 2,5,main]) started.\n        \n        \u003e Task :project-b:jar UP-TO-DATE\n        Skipping task ':project-b:jar' as it is up-to-date.\n        :project-b:jar (Thread[Task worker for ':project-b' Thread 2,5,main]) completed. Took 0.002 secs.\n        :compileJava (Thread[Task worker for ':' Thread 4,5,main]) started.\n        \n        \u003e Task :compileJava UP-TO-DATE\n        Skipping task ':compileJava' as it is up-to-date.\n        :compileJava (Thread[Task worker for ':' Thread 4,5,main]) completed. Took 0.004 secs.\n        :classes (Thread[Task worker for ':' Thread 4,5,main]) started.\n        \n        \u003e Task :classes UP-TO-DATE\n        Skipping task ':classes' as it has no actions.\n        :classes (Thread[Task worker for ':' Thread 4,5,main]) completed. Took 0.0 secs.\n\n        BUILD SUCCESSFUL in 0s\n\n### Build Project D\nRun the following commands to build [project-d](project-d):\n\n1. Change the working directory to [project-d](project-d):\n\n        cd project-d\n        \n2. Run the following command to generate classes for the project:\n\n        ./gradlew classes --info\n        \n    Notice that only [project-d](project-d) was configured and built:\n        \n        \u003e Configure project :\n        Evaluating root project 'project-d' using build file '/Users/greg/workspace/gradle-compositebuild-example/project-d/build.gradle'.\n        All projects evaluated.\n        Selected primary task 'classes' from project :\n        Tasks to be executed: [task ':compileJava', task ':processResources', task ':classes']\n        :compileJava (Thread[Task worker for ':',5,main]) started.\n        \n        \u003e Task :compileJava UP-TO-DATE\n        Skipping task ':compileJava' as it is up-to-date.\n        :compileJava (Thread[Task worker for ':',5,main]) completed. Took 0.006 secs.\n        :processResources (Thread[Task worker for ':',5,main]) started.\n        \n        \u003e Task :processResources NO-SOURCE\n        Skipping task ':processResources' as it has no source files and no previous output files.\n        :processResources (Thread[Task worker for ':',5,main]) completed. Took 0.0 secs.\n        :classes (Thread[Task worker for ':',5,main]) started.\n        \n        \u003e Task :classes UP-TO-DATE\n        Skipping task ':classes' as it has no actions.\n        :classes (Thread[Task worker for ':',5,main]) completed. Took 0.0 secs.\n        \n        BUILD SUCCESSFUL in 0s\n        \n## Working in IntelliJ\nIntelliJ supports Gradle Composite Builds and will automatically open any included builds for a project.\n\nTo see this in action, open [project-a](project-a) in your IntelliJ IDE. You will notice that IntelliJ automatically\nopens [project-b](project-d) because it is a dependency of the current project.\n\n![intellij](intellij_screenshot.png)\n\n## Bugs and Feedback\nFor bugs, questions, and discussions please use the [Github Issues](https://github.com/gregwhitaker/gradle-monorepo-example/issues).\n\n## License\nMIT License\n\nCopyright (c) 2019 Greg Whitaker\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregwhitaker%2Fgradle-monorepo-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregwhitaker%2Fgradle-monorepo-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregwhitaker%2Fgradle-monorepo-example/lists"}