From 3f54961ac6f277f082c04d1f12ae564149fdfede Mon Sep 17 00:00:00 2001 From: Danil Nikolaev Date: Sat, 24 Jan 2026 11:35:16 +0300 Subject: [PATCH] Build: Add support for Nexus repository This commit updates the Gradle settings to allow specifying Nexus repositories for both plugins and dependencies. It reads the repository URLs from Gradle properties or environment variables (`NEXUS_PLUGINS_URL` and `NEXUS_MAVEN_URL`). If these properties are set, the corresponding Nexus Maven repositories are added to the build configuration. --- settings.gradle.kts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/settings.gradle.kts b/settings.gradle.kts index 462ebbfe..b6782c43 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,8 +1,15 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") pluginManagement { + val nexusPluginsUrl = providers.gradleProperty("NEXUS_PLUGINS_URL") + .orElse(providers.environmentVariable("NEXUS_PLUGINS_URL")) + .orNull + includeBuild("build-logic") repositories { + if (!nexusPluginsUrl.isNullOrBlank()) { + maven(url = uri(nexusPluginsUrl)) + } google() mavenCentral() gradlePluginPortal() @@ -10,7 +17,16 @@ pluginManagement { } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + + val nexusMavenUrl = providers.gradleProperty("NEXUS_MAVEN_URL") + .orElse(providers.environmentVariable("NEXUS_MAVEN_URL")) + .orNull + + repositories { + if (!nexusMavenUrl.isNullOrBlank()) { + maven(url = uri(nexusMavenUrl)) + } google() mavenCentral() }