编译cm时,maven Read timed out

我在编译Nexus 5X cm13时,遇到了maven拉取一个apk总是Timeout.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.10:get (default-cli) on project standalone-pom: Couldn't download artifact: Could not transfer artifact org.cyanogenmod:gello:apk:40 from/to central (https://maven.cyanogenmod.org/artifactory/gello_prebuilds): GET request of: org/cyanogenmod/gello/40/gello-40.apk from central failed
[ERROR] org.cyanogenmod:gello:apk:40
[ERROR] 
[ERROR] from the specified remote repositories:
[ERROR] central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false),
[ERROR] central (https://maven.cyanogenmod.org/artifactory/gello_prebuilds, releases=true, snapshots=true): Read timed out
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
vendor/cm/build/core/maven_artifact.mk:42: recipe for target '/home/android/source/outdir/cm/target/common/obj/APPS/Gello_intermediates/org.cyanogenmod.gello-40.apk' failed
make: *** [/home/android/source/outdir/cm/target/common/obj/APPS/Gello_intermediates/org.cyanogenmod.gello-40.apk] Error 1
make: Leaving directory '/home/android/source/cm'

解决方案:设置maven http代理
修改maven配置文件 ~/.m2/settings.xml, 如果没有该文件,就新建一个,内容如下:

<settings>
  <proxies>
    <proxy>
      <id>example-proxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>127.0.0.1</host>
      <port>1080</port>
    </proxy>
  </proxies>
</settings>

host:代理服务器的地址
port:代理服务器的端口

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容