Refactor local Maven repository resolution in Gradle settings #2

Merged
NotAlexNoyle merged 1 commits from codex/refactor-mavenlocal-for-trueog-bootstrap-compatibility into master 2026-03-18 07:09:29 -04:00
NotAlexNoyle commented 2026-03-18 07:09:19 -04:00 (Migrated from github.com)

Motivation

  • Make Gradle repository resolution compatible with TrueOG Bootstrap by importing local repositories as file-based maven entries instead of relying solely on mavenLocal().
  • Support an override via the SELF_MAVEN_LOCAL_REPO system property with proper ~ expansion and validation.

Description

  • Added an explicit maven { url = uri("file://${System.getProperty("user.home")}/.m2/repository") } entry to prefer the user's ~/.m2/repository as a file-based repository.
  • Replaced the previous mavenLocal()-only lookup with System.getProperty("SELF_MAVEN_LOCAL_REPO") handling that expands leading ~, converts the path to a file(...), and registers it via maven { url = uri("file://${dir.absolutePath}") } when the directory exists.
  • When the SELF_MAVEN_LOCAL_REPO path is missing or not a directory the code logs an error and falls back to mavenLocal() to preserve previous behavior.
  • Modified file: settings.gradle.kts.

Testing

  • Ran ./gradlew help, which failed in this environment with Gradle reporting: What went wrong: 25.0.1 (build did not complete successfully).
  • No other automated tests were executed in this environment.

Codex Task

### Motivation - Make Gradle repository resolution compatible with TrueOG Bootstrap by importing local repositories as file-based `maven` entries instead of relying solely on `mavenLocal()`. - Support an override via the `SELF_MAVEN_LOCAL_REPO` system property with proper `~` expansion and validation. ### Description - Added an explicit `maven { url = uri("file://${System.getProperty("user.home")}/.m2/repository") }` entry to prefer the user's `~/.m2/repository` as a file-based repository. - Replaced the previous `mavenLocal()`-only lookup with `System.getProperty("SELF_MAVEN_LOCAL_REPO")` handling that expands leading `~`, converts the path to a `file(...)`, and registers it via `maven { url = uri("file://${dir.absolutePath}") }` when the directory exists. - When the `SELF_MAVEN_LOCAL_REPO` path is missing or not a directory the code logs an error and falls back to `mavenLocal()` to preserve previous behavior. - Modified file: `settings.gradle.kts`. ### Testing - Ran `./gradlew help`, which failed in this environment with Gradle reporting: `What went wrong: 25.0.1` (build did not complete successfully). - No other automated tests were executed in this environment. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69ba86e07850832fad03efed1ddd4acd)
Sign in to join this conversation.