{"id":22750900,"url":"https://github.com/srdjan-v/localgitdependency","last_synced_at":"2026-05-11T06:02:19.965Z","repository":{"id":65962013,"uuid":"598254889","full_name":"Srdjan-V/LocalGitDependency","owner":"Srdjan-V","description":"A plugin to build gradle project and add them as dependencies","archived":false,"fork":false,"pushed_at":"2024-04-20T20:29:16.000Z","size":824,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-05T08:33:52.213Z","etag":null,"topics":["dependency","git","gradle","gradle-plugin","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Srdjan-V.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}},"created_at":"2023-02-06T18:18:47.000Z","updated_at":"2024-06-02T04:07:59.000Z","dependencies_parsed_at":"2024-04-20T21:29:10.912Z","dependency_job_id":"5a6bd195-a0bb-4881-a847-1c6d2f9df64f","html_url":"https://github.com/Srdjan-V/LocalGitDependency","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Srdjan-V%2FLocalGitDependency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Srdjan-V%2FLocalGitDependency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Srdjan-V%2FLocalGitDependency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Srdjan-V%2FLocalGitDependency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Srdjan-V","download_url":"https://codeload.github.com/Srdjan-V/LocalGitDependency/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246285612,"owners_count":20752943,"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":["dependency","git","gradle","gradle-plugin","java"],"created_at":"2024-12-11T04:18:45.303Z","updated_at":"2026-05-11T06:02:19.898Z","avatar_url":"https://github.com/Srdjan-V.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"LocalGitDependency\n=====================\n\nGradle plugin to build external git repositories and add them as dependencies.\n*The main focus of this plugin are java project, other types may or may not work*\n\n*Minimum gradle version for dependency projects 4.10.0*\n\n**Note this plugin is still actively developed, braking changes might get introduced.**\n\n### Setup ###\n\nYou can add this plugin to your top-level build script using the following configuration:\n\n### `plugins` block:\n\n```groovy\nplugins {\n    id \"io.github.srdjanv.local-git-dependency\" version \"$version\"\n}\n```\n\nor via the\n\n### `buildscript` block:\n\n```groovy\n\nbuildscript {\n    repositories {\n        gradlePluginPortal()\n    }\n\n    dependencies {\n        classpath \"io.github.srdjanv.local-git-dependency:$version\"\n    }\n}\n\napply plugin: \"io.github.srdjanv.local-git-dependency\"\n```\n\n### Technical Explanation  ###\n\nThe [PluginBuilder](https://github.com/Srdjan-V/LocalGitDependency/blob/master/src/main/java/io/github/srdjanv/localgitdependency/config/plugin/PluginBuilder.java)\nis used to configure basic plugin behaviour\n\nThe [DefaultableBuilder](https://github.com/Srdjan-V/LocalGitDependency/blob/master/src/main/java/io/github/srdjanv/localgitdependency/config/dependency/defaultable/DefaultableBuilder.java)\nis used to configure the defaults of all registered dependencies\n\nIt is possible to specify how the build dependency will be added to the\nproject,\nsee [Dependency.Types](https://github.com/Srdjan-V/LocalGitDependency/blob/master/src/main/java/io/github/srdjanv/localgitdependency/depenency/Dependency.java#L137)\n\nThe default properties are located in\nthe [ConfigManager](https://github.com/Srdjan-V/LocalGitDependency/blob/master/src/main/java/iogithub/srdjanv/localgitdependency/config/ConfigManager.java)\n\n### Plugin Configuration ###\n\nYou can change the directories that the plugin uses, the paths can be absolute or relative.\nChanging global paths requires you to manually enable or disable the cleanup-manager,\nthe manager will delete anything under thous directories that doesn't mach the registered dependencies\n\n```\nlocalGitDependency {\n    configurePlugin {\n        automaticCleanup false\n        gitDir \"./yourGitDir\"\n        persistentDir new File(\"./yourPersistentDir\")\n        mavenDir \"/rootMaven\"\n    }\n}\n```\n\n### Dependency Configuration ###\n\n### Basic ###\n\nWith this way the ide can tell to what object the closure will\ndelegate\n\n```\nlocalGitDependency {\n    add(\"https://example.com/repository.git\")\n\n    add(\"https://example.com/repository.git\", {\n        name \"test\"\n    })\n\n    add(implementation, \"https://example.com/repository.git\")\n\n    add(implementation \"https://example.com/repository.git\", {\n        name \"test\"\n    })\n}\n```\n\nYou can use the dynamic add method to registrar dependencies, this only allows for shorter declaration.\n\n```\nlocalGitDependency {\n    \"https://example.com/repository.git\"\n\n    \"https://example.com/repository.git\" {\n        name \"test\"\n    }\n\n    implementation \"https://example.com/repository.git\"\n\n    implementation \"https://example.com/repository.git\", {\n        name \"test\"\n    }\n}\n```\n\nThe plugin can try to generate source or javadoc jars for the dependency\n\n```\nlocalGitDependency {\n    configureDefaultable {\n        tryGeneratingSourceJar = true\n        tryGeneratingJavaDocJar = true\n    }\n    \n    add(\"https://example.com/repository.git\", {\n        //this is overwritten the global configuration\n        tryGeneratingJavaDocJar = false\n    })\n}\n```\n\n### Complex ###\n\n#### Artifact Handling ####\n\nYou are able to fine tune what generated artifacts are going to be used, and how they are going to get configured\n\n```\nlocalGitDependency {\n    add(\"https://example.com/repository.git\", {\n        configuration({\n            configuration \"runtimeOnly\"\n            closure ({\n                transitive false\n            })\n            include \"notation\", \"someOtherNotation\"\n            include [\"mapNotation\": {\n                transitive true\n            }]\n        }, {\n            configuration \"someOtherConfiguration\"\n            exclude \"notation\", \"someOtherNotation\"\n        })\n    })\n}\n```\n\n#### Gradle Interaction ####\n\nThe build process in decided into several stages, startup, probe and build. Each one has its one pre, main and post\ntasks and arguments\n\n```\nlocalGitDependency {\n    add('https://example.com/repository.git', {\n        buildLauncher {\n            startup {\n                preTaksWithArguments \"CustomArgs\"\n                preTaks \"SomeTask\"\n            }\n            probe {\n                mainTaksWithArguments \"CustomArgs\"\n                mainTaks \"SomeTask\"\n            }\n            probe {\n                postTasksWithArguments \"CustomArgs\"\n                postTasks \"SomeTask\"\n            }\n        }\n    })\n}\n```\n\nEach stages run condition can be configured individually\n```\nlocalGitDependency {\n    add('https://example.com/repository.git', {\n        buildLauncher {\n            startup {\n                setTaskTriggers \".gitignore\"\n                addTaskTriggers \"gradle.properties\"\n            }\n            build {\n                explicit true// this stage will now always run. its used to add custom condition with your build file\n            }\n        }\n    })\n}\n```\n\n\n### MultiProject IDE integration ###\n\nTo enable this you need to set `enableIdeSupport` to true.\nIdeally the generated jars should be added to a runtimeOnly configuration, and source sets should be mapped\n\n```\nlocalGitDependency {\n    add('https://example.com/repository.git', {\n        configuration \"runtimeOnly\"\n        enableIdeSupport = true\n        mapSourceSets({\n            map \"main//The main source set of the cuurent project\", \"main//The main source set of the dep\", \"someOtherSourceSet//Some other source set of the dep\"\n        }, {\n            map \"test//The test source set of the cuurent project\", \"someOtherSourceSet\"\n        })\n    })\n}\n```\n## Thanks ###\n\n- \u003ca href=\"https://jb.gg/OpenSource\"\u003e\u003cimg src=\"https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png?_gl=1*98642y*_ga*MTIxMDA5OTM5Ni4xNjgwMzQyNjgy*_ga_9J976DJZ68*MTY4MTIxMDIzMy41LjEuMTY4MTIxMTE1MS4wLjAuMA..\u0026_ga=2.268101710.1369693703.1681210234-1210099396.1680342682\" width=\"100px\" alt=\"jetbrains\"\u003e\n- **Thanks to JetBrains for the free open source license**\u003c/a\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrdjan-v%2Flocalgitdependency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrdjan-v%2Flocalgitdependency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrdjan-v%2Flocalgitdependency/lists"}