Загрузка данных


build.gradle.kts
"val tokenName: String by project
val tokenPassword: String by project
val nexusPublicRepository: String by project
val nexusInternalRepository: String by project

// Репозиторий
buildscript {
  repositories {
    // Публичный
    maven {
      url = uri(nexusPublicRepository)
      isAllowInsecureProtocol = true
      credentials {
        username = tokenName
        password = tokenPassword
      }
    }
    // Внутренний
    maven {
      url = uri(nexusInternalRepository)
      isAllowInsecureProtocol = true
      credentials {
        username = tokenName
        password = tokenPassword
      }
    }
    // fallback
    mavenCentral()
  }
  dependencies {
    // Подключаем Allure Gradle Plugin как classpath
    classpath("io.qameta.allure:allure-gradle:2.3")
  }
}

// Применяем плагин после buildscript
apply(plugin = "io.qameta.allure")

plugins {
  java
}"
gradle.properties
"# Dependency repositories
nexusPublicRepository=https://nsecretpublic/
nexusInternalRepository=https://nexusecret/maven-lib-int/
tokenName = secret
tokenPassword = secret"
settings.gradle.kts
"...
pluginManagement {
    // Получаем токены из ~/.gradle/gradle.properties
    val tokenName = providers.systemProperty("tokenName").orNull
    val tokenPassword = providers.systemProperty("tokenPassword").orNull

    // Задаём URL репозиториев
    val nexusPublicRepository = "https://nsecret/public/"
    val nexusInternalRepository = "https://nsecret/maven-lib-int/"

    repositories {
        listOf(nexusPublicRepository, nexusInternalRepository).forEach {
            maven {
                url = uri(it)
                isAllowInsecureProtocol = true
                credentials {
                    username = tokenName
                    password = tokenPassword
                }
            }
        }
    }
}"