LINUX.ORG.RU

Google() репозиторий в gradle через Artifactory или nexus для сборки Android приложений

 , , ,


0

1

Есть Android проект, который скачивает зависимости напряму через интернет.

В файле build.gradle указано:

    repositories {
        google()
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
        maven { url 'https://plugins.gradle.org/m2/' }
    }

Как сделать чтобы зависимости качались для репозитория google() и других репозиториев качались через артифактори или nexus ?



Последнее исправление: chemtech (всего исправлений: 2)

Подложил


buildscript {
    ext.kotlin_version = '1.3.50'

    repositories {
        maven { url 'http://artifactory/artifactory/repo' }
        maven { url 'http://artifactory/artifactory/remote-repos' }
        maven { url 'http://artifactory/artifactory/libs-release' }
        maven { url 'http://artifactory/artifactory/libs-snapshot' }
        maven { url 'http://artifactory/artifactory/plugins-release' }
        maven { url 'http://artifactory/artifactory/plugins-snapshot' }
        
    }
    dependencies {
        classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release"
        classpath 'com.android.tools.build:gradle:3.5.1'
        classpath 'io.fabric.tools:gradle:1.29.0'
        classpath "io.realm:realm-gradle-plugin:5.10.0"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'net.researchgate:gradle-release:2.6.0'

    }
}

allprojects {
    repositories {
        maven { url 'http://artifactory/artifactory/repo' }
        maven { url 'http://artifactory/artifactory/remote-repos' }
        maven { url 'http://artifactory/artifactory/libs-release' }
        maven { url 'http://artifactory/artifactory/libs-snapshot' }
        maven { url 'http://artifactory/artifactory/plugins-release' }
        maven { url 'http://artifactory/artifactory/plugins-snapshot' }
    }
}

}

Но теперь другая ошибка.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'sortmaster_android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve io.fabric.tools:gradle:1.29.0.
     Required by:
         project :
      > Could not resolve io.fabric.tools:gradle:1.29.0.
         > Could not get resource 'http://artifactory/artifactory/repo/io/fabric/tools/gradle/1.29.0/gradle-1.29.0.pom'.
            > Could not GET 'http://artifactory/artifactory/repo/io/fabric/tools/gradle/1.29.0/gradle-1.29.0.pom'. Received status code 401 from server: Unauthorized
      > Could not resolve io.fabric.tools:gradle:1.29.0.
         > Could not get resource 'http://artifactory/artifactory/remote-repos/io/fabric/tools/gradle/1.29.0/gradle-1.29.0.pom'.
            > Could not GET 'http://artifactory/artifactory/remote-repos/io/fabric/tools/gradle/1.29.0/gradle-1.29.0.pom'. Received status code 401 from server: Unauthorized
      > Could not resolve io.fabric.tools:gradle:1.29.0.
         > Could not get resource 'http://artifactory/artifactory/plugins-release/io/fabric/tools/gradle/1.29.0/gradle-1.29.0.pom'.
            > Could not GET 'http://artifactory/artifactory/plugins-release/io/fabric/tools/gradle/1.29.0/gradle-1.29.0.pom'. Received status code 401 from server: Unauthorized

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
chemtech
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.