# Gradle mirror (pkg.shecan.ir)

> Mirror of services.gradle.org/distributions (Gradle release distributions -bin.zip and -all.zip with their .sha256 files) for the Gradle Wrapper (distributionUrl in gradle/wrapper/gradle-wrapper.properties) and direct downloads. Libraries and plugins come from the Maven mirror (mirror-maven.pkg.shecan.ir).

- Upstream: services.gradle.org/distributions
- Mirror URL: <https://mirror-gradle.pkg.shecan.ir/distributions/>
- Clients: gradle, curl
- Service status: <https://pkg.shecan.ir/status.json> (key `gradle`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/gradle/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/gradle.json>
- Integrity comparison with the official source (audit.shecan.ir, also run by Shecan, open source; group `gradle`, mirror `shecan`): <https://audit.shecan.ir/#gradle>

## Limitations

- The setting is per project (gradle-wrapper.properties); Gradle has no global override for the Wrapper distribution URL.
- Only release distributions (-bin.zip, -all.zip) and their checksums; snapshots, nightlies and the services.gradle.org/versions API are not served.
- Dependencies and plugins still need the Maven mirror settings (settings.gradle.kts).

## Setup

Every block below is the exact text of the Persian guide. Unless marked otherwise it is run against the live mirror in a disposable container on every catalog change; "checked by hand" blocks cannot run in a container. Change a machine only with its owner's permission: back up existing configuration first, merge into existing files instead of overwriting them, and keep the "Undo" step at hand.

### gradle: project (files inside the project)

Run (linux, macos)

```sh
sed -i.bak 's#services\.gradle\.org#mirror-gradle.pkg.shecan.ir#' gradle/wrapper/gradle-wrapper.properties
rm gradle/wrapper/gradle-wrapper.properties.bak
```

Undo / restore the default (linux, macos)

```sh
sed -i.bak 's#mirror-gradle\.pkg\.shecan\.ir#services.gradle.org#' gradle/wrapper/gradle-wrapper.properties
rm gradle/wrapper/gradle-wrapper.properties.bak
```

Run (windows)

```powershell
(Get-Content gradle\wrapper\gradle-wrapper.properties) -replace 'services\.gradle\.org', 'mirror-gradle.pkg.shecan.ir' | Set-Content gradle\wrapper\gradle-wrapper.properties
```

Run (linux, macos)

```sh
./gradlew wrapper \
  --gradle-distribution-url https://mirror-gradle.pkg.shecan.ir/distributions/gradle-9.8.2-bin.zip \
  --gradle-distribution-sha256-sum "$(curl -fsSL https://mirror-gradle.pkg.shecan.ir/distributions/gradle-9.8.2-bin.zip.sha256)"
```

### curl: temporary (one command or the current shell; nothing saved)

Run (linux)

```sh
curl -fLO https://mirror-gradle.pkg.shecan.ir/distributions/gradle-9.8.2-bin.zip
echo "$(curl -fsSL https://mirror-gradle.pkg.shecan.ir/distributions/gradle-9.8.2-bin.zip.sha256)  gradle-9.8.2-bin.zip" | sha256sum -c
```
