android– 如何加快我的gradle构建并跳过失败的依赖项查找?

android– 如何加快我的gradle构建并跳过失败的依赖项查找?,第1张

概述我有一个androidgradle构建,它在四个不同的服务器上查找依赖项.现在构建需要两分钟,因为每次构建都会检查这些依赖项.可能发生这种情况是因为其中一个存储库为大多数依赖项返回错误.我的gradle文件中有以下来源:repositories{maven{url'http://jenkins.local:8081ex

我有一个android gradle构建,它在四个不同的服务器上查找依赖项.

现在构建需要两分钟,因为每次构建都会检查这些依赖项.
可能发生这种情况是因为其中一个存储库为大多数依赖项返回错误.

我的gradle文件中有以下来源:

repositorIEs {   maven { url 'http://jenkins.local:8081/nexus/content/groups/public/' }   mavenCentral()   maven { url 'https://oss.sonatype.org/content/repositorIEs/snapshots/'}   maven {url "https://repo.commonsware.com.s3.amazonaws.com"}}

第一个条目是一个代理,它应该在第一个请求之后缓存所有工件.
这是依赖列表的一部分:

编译’com.androID.support:support-v4:19. “

compile 'com.squareup.picasso:picasso:2.2.+'compile 'com.commonsware.cwac:merge:1.0.1'compile files('libs/crittercism_v4_3_0_sdkonly.jar')testCompile 'junit:junit:4.10'testCompile 'org.robolectric:robolectric:2.3-SNAPSHOT'testCompile 'com.squareup:fest-androID:1.0.+'testCompile 'org.mockito:mockito-all:1.9.5'instrumentTestCompile 'junit:junit:4.10'instrumentTestCompile 'org.robolectric:robolectric:2.3-SNAPSHOT'instrumentTestCompile 'com.squareup:fest-androID:1.0.+'instrumentTestCompile 'org.mockito:mockito-all:1.9.5'

现在,在运行gradle时,我得到以下输出(同样是快照):

Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/de/greenrobot/greendao/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/androID/support/support-v4/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/androID/support/support-v4/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/squareup/picasso/picasso/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/squareup/picasso/picasso/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/squareup/picasso/picasso/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/squareup/picasso/picasso/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/androID/support/appcompat-v7/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/androID/support/appcompat-v7/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/androID/support/mediarouter-v7/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/androID/support/mediarouter-v7/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/androID/support/support-v4/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/androID/support/support-v4/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/fasterxml/jackson/core/jackson-databind/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/fasterxml/jackson/core/jackson-databind/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/fasterxml/jackson/core/jackson-core/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/fasterxml/jackson/core/jackson-core/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/fasterxml/jackson/core/jackson-annotations/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/fasterxml/jackson/core/jackson-annotations/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/squareup/okhttp/okhttp/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/squareup/okhttp/okhttp/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/squareup/retrofit/retrofit/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/squareup/retrofit/retrofit/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/de/greenrobot/greendao/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/de/greenrobot/greendao/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/androID/support/support-v4/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/androID/support/support-v4/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/squareup/picasso/picasso/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/squareup/picasso/picasso/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/squareup/picasso/picasso/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/squareup/picasso/picasso/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/androID/support/appcompat-v7/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/androID/support/appcompat-v7/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/androID/support/mediarouter-v7/maven-Metadata.xml]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/androID/support/mediarouter-v7/]Failed to get resource: GET. [http http/1.1 403 ForbIDden: https://repo.commonsware.com.s3.amazonaws.com/com/androID/support/support-v4/maven-Metadata.xml]

我如何强制构建每天只执行一次此查找,或者跳过上次失败的查找或者获取找到的第一个工件并跳过已经可用的工件的所有其他存储库?

解决方法:

这个故事的寓意:确保你的Maven存储库为任何实际上不存在的东西返回404.

在Amazon S3上托管存储库的特定情况下,使用Amazon S3 Manager向“Everyone”授予“List”权限,或者按照this StackOverflow answer中的说明进行 *** 作.

总结

以上是内存溢出为你收集整理的android – 如何加快我的gradle构建并跳过失败的依赖项查找?全部内容,希望文章能够帮你解决android – 如何加快我的gradle构建并跳过失败的依赖项查找?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1117071.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存