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.
This commit is contained in:
2026-01-24 11:35:16 +03:00
parent 045f2e8268
commit 3f54961ac6
+16
View File
@@ -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()
}