Search Docs
Loading...
Skip to content

Create a Local Maven Repository for Offline Builds

Mirror all IMG.LY Android artifacts for a specific CE.SDK version and configure Gradle to resolve them from a local Maven repository.

CE.SDK Android artifacts flowing from the IMG.LY Maven repository into a local offline repository
5 mins
estimated time
Download

The download script uses the public IMG.LY Maven repository and preserves its directory structure. It does not require Artifactory access or credentials.

Requirements#

Prepare the repository on a machine with:

  • Network access to https://maven.img.ly
  • Bash
  • curl
  • jq
  • The CE.SDK version used by your Android project

Download the Script#

Use the download action above, or download the script from the command line:

Terminal window
curl --remote-name https://img.ly/docs/cesdk/downloads/download-maven-version.sh
chmod +x download-maven-version.sh

You can inspect the matching files without downloading them:

Terminal window
./download-maven-version.sh --dry-run 1.80.0

Download IMG.LY Artifacts#

Run the script with the CE.SDK version and the output directory:

Terminal window
./download-maven-version.sh 1.80.0 ./maven-offline

The script downloads every file in an exact 1.80.0 version directory and keeps the Maven layout. The generated local repository starts at maven-offline/maven and contains paths such as ly/img/editor-core/1.80.0/.

Transfer the Repository#

Copy the complete maven-offline directory to the target environment. Keep its directory structure unchanged. You can place it inside the Android project or at another stable filesystem location available to Gradle.

Configure Gradle#

Register the maven subdirectory inside dependencyResolutionManagement.repositories in your project’s settings file.

settings.gradle.kts
dependencyResolutionManagement {
repositories {
maven {
name = "imgly-offline"
url = uri(rootDir.resolve("maven-offline/maven"))
mavenContent {
includeGroup("ly.img")
}
}
google()
mavenCentral()
}
}

Adjust the filesystem path if the repository is outside the project. mavenContent restricts this repository to the ly.img group so Gradle continues to resolve other groups from their configured repositories.

Verify Offline Resolution#

Run a representative build with Gradle’s offline mode enabled:

Terminal window
./gradlew --offline assembleDebug

The build now resolves CE.SDK artifacts from the local repository. If Gradle reports a missing artifact from another group, add that artifact to the appropriate third-party repository mirror or cache.

Troubleshooting#

No Artifacts Found#

Confirm that the requested CE.SDK version exists in the IMG.LY Maven repository and exactly matches the version declared in your Gradle dependencies.

curl or jq Is Missing#

Install the missing command on the connected preparation machine, then run the script again. Both commands are required to browse the repository and download files safely.

Gradle Still Requests Network Access#

The local repository contains IMG.LY artifacts only. Mirror or cache Gradle, Android Gradle Plugin dependencies, and all transitive dependencies from Google Maven, Maven Central, and any other repositories used by your project.