{"id":41455555,"url":"https://github.com/uzzu/dotenv-gradle","last_synced_at":"2026-01-23T15:37:09.576Z","repository":{"id":40651156,"uuid":"239700970","full_name":"uzzu/dotenv-gradle","owner":"uzzu","description":"A Gradle plugin provides environment variable extension, and supported \".env\" file.","archived":false,"fork":false,"pushed_at":"2025-12-12T21:35:44.000Z","size":310,"stargazers_count":83,"open_issues_count":17,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-14T11:58:14.571Z","etag":null,"topics":["dotenv","gradle-plugin","kotlin","kotlin-dsl"],"latest_commit_sha":null,"homepage":"https://plugins.gradle.org/plugin/co.uzzu.dotenv.gradle","language":"Kotlin","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/uzzu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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-02-11T07:22:17.000Z","updated_at":"2025-11-16T12:28:32.000Z","dependencies_parsed_at":"2023-12-09T08:24:47.414Z","dependency_job_id":"b476eb1d-1e17-4103-b3bd-0d1aa2593b40","html_url":"https://github.com/uzzu/dotenv-gradle","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/uzzu/dotenv-gradle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uzzu%2Fdotenv-gradle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uzzu%2Fdotenv-gradle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uzzu%2Fdotenv-gradle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uzzu%2Fdotenv-gradle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uzzu","download_url":"https://codeload.github.com/uzzu/dotenv-gradle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uzzu%2Fdotenv-gradle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28694740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T14:15:13.573Z","status":"ssl_error","status_checked_at":"2026-01-23T14:09:05.534Z","response_time":59,"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":["dotenv","gradle-plugin","kotlin","kotlin-dsl"],"created_at":"2026-01-23T15:37:08.908Z","updated_at":"2026-01-23T15:37:09.559Z","avatar_url":"https://github.com/uzzu.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dotenv Gradle\n\n![main](https://github.com/uzzu/dotenv-gradle/workflows/main/badge.svg) [![ktlint](https://img.shields.io/badge/code%20style-%E2%9D%A4-FF4081.svg)](https://ktlint.github.io/)\n[![Gradle Plugin Portal](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/co/uzzu/dotenv/gradle/co.uzzu.dotenv.gradle.gradle.plugin/maven-metadata.xml.svg?colorB=007ec6\u0026label=gradlePluginPortal)](https://plugins.gradle.org/plugin/co.uzzu.dotenv.gradle)\n\n**Provides dotenv (`.env`) and dotenv templates (`.env.template`) as variables in a Project extension.**\n\n## How to use\n\n### Setup\n\nApply this plugin to the root project. [Read the Gradle Plugin Portal to setup the plugin.](https://plugins.gradle.org/plugin/co.uzzu.dotenv.gradle).\n\nNote that this plugin is not registered to Maven Central.\n\nYou do not need to apply this plugin to subprojects; the values are applied automatically.\n\n### Create `.env` in the root directory of your gradle project\n\nFor example:\n\n```dosini\nFOO=foo\nBAR=\"bar\"\nBAZ='baz'\n\n# You can comment out lines with a #\n; You can comment out lines with a ;\n```\n\nThen, you will be able to use the environment variables in your gradle scripts:\n\n```Kotlin\nprintln(env.FOO.isPresent)              // =\u003e true\nprintln(env.FOO.value)                  // =\u003e foo\nprintln(env.BAR.orNull())               // =\u003e bar\nprintln(env.BAZ.orElse(\"default baz\"))  // =\u003e baz\n```\n\n**Don't commit the `.env` file.** Ideally, add it to your `.gitignore` file.\n\n### API\n\n- `(Boolean) env.isPresent(name: String)`: Indicates that an environment variable with specified name is present.\n\n- `(String) env.fetch(name: String)`: Returns the environment variable of the given name.\n\n- `(String) env.fetch(name: String, defaultValue: String)`: Returns an environment variable, or specified default value if environment variable was not set.\n\n- `(String?) env.fetchOrNull(name: String)`: Returns an environment variable, or `null` if the environment variable was not set.\n\n- `(Map\u003cString, String) env.allVariables()`: Returns all environment variables.\n\n- `(Map\u003cString, String?) env.allVariablesOrNull()`: Returns all environment variables, and includes `null` values for unset variables.\n\n### Templates\n\nIf a `.env.template` file exists, this plugin populates environment variables names from the template, too. This means you can use the template to define the environment variables that are required for your project, and override them in the `.env` file. Values within the `.env.template` file are *not* populated when read, all values will be `null`.\n\n[See the `change_template_file` example](/examples/change_template_file) for more details.\n\n### Changing the name of the `.env` file\n\nYou can also use a different name for the `.env` file. [See this example](/examples/change_file) on how to do this.\n\n### Hierarchical dotenv definitions\n\nThis project supports subproject-only variables and extensions.\n\n[See this example](/examples/hierarchical_definitions) for more details.\n\n### Other Features/Functions\n\nNote that all APIs of this `env` extension consider the `.env` file.\n\nIf the same variable name value is defined in both the `.env` file and system environment variables, the system environment variable takes precedence.\n\n[See more examples](/examples).\n\n## Restrictions\n\nThis plugin does not support specifying properties with the `-P` option of CLI arguments, and there are no plans to support it in the future. See [#67](https://github.com/uzzu/dotenv-gradle/issues/67)\n\n## License\n\n[Apache License 2.0](/LICENSE.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuzzu%2Fdotenv-gradle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuzzu%2Fdotenv-gradle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuzzu%2Fdotenv-gradle/lists"}