Answer the question
In order to leave comments, you need to log in
How to build a project in Gradle when there is no internet?
There is someone else's project on Gradle. The problem is that when building, gradle tries to download dependencies from the Internet, and for some reason it fails (probably connection problems). How to build a project by downloading components manually? Where to put them?
Answer the question
In order to leave comments, you need to log in
You need to check the definition of existing Maven / Ivy repositories in the build.gradle of the desired module.
And here's what you can do there:
repositories {
ivy {
url "http://mycompany.com/repo" // нужно проверить доступность
// или
url "../local-ivy-repo" // для локальной папки с Ivy репозиторием
// В Ivy можно указать структуру каталогов для поиска и путь к ivy.xml явно
// Таким образом можно описать путь для любых зависимостей по http/https'у
layout 'pattern' , {
artifact '[module]/[revision]/[artifact](.[ext])'
ivy '[module]/[revision]/ivy.xml'
}
}
// Тоже самое можно и для Maven'a
maven {
url "http://repo.mycompany.com/maven2"
// или
url "../local-maven-repo"
// В MavenArtifactRepository нет возможности прописать Layout, по понятным причинам
// А ещё и в Ivy и в Maven'e можно указать пароль к AWS'у или http auth, правда это нестабильная фича
credentials { // или credentials(AwsCredentials) {
accessKey "myAccessKey"
secretKey "mySecret"
}
}
}
dependencies {
runtime files('libs/a.jar', 'libs/b.jar')
// ну, или так
runtime fileTree(dir: 'libs', include: '*.jar')
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question