forked from melod1n/fast-messenger
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:
@@ -1,8 +1,15 @@
|
|||||||
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||||
|
|
||||||
pluginManagement {
|
pluginManagement {
|
||||||
|
val nexusPluginsUrl = providers.gradleProperty("NEXUS_PLUGINS_URL")
|
||||||
|
.orElse(providers.environmentVariable("NEXUS_PLUGINS_URL"))
|
||||||
|
.orNull
|
||||||
|
|
||||||
includeBuild("build-logic")
|
includeBuild("build-logic")
|
||||||
repositories {
|
repositories {
|
||||||
|
if (!nexusPluginsUrl.isNullOrBlank()) {
|
||||||
|
maven(url = uri(nexusPluginsUrl))
|
||||||
|
}
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
@@ -10,7 +17,16 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
|
|
||||||
|
val nexusMavenUrl = providers.gradleProperty("NEXUS_MAVEN_URL")
|
||||||
|
.orElse(providers.environmentVariable("NEXUS_MAVEN_URL"))
|
||||||
|
.orNull
|
||||||
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
if (!nexusMavenUrl.isNullOrBlank()) {
|
||||||
|
maven(url = uri(nexusMavenUrl))
|
||||||
|
}
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user