编译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, 如果没有该文件,就新建一个,内容如下:


  
    
      example-proxy
      true
      http
      127.0.0.1
      1080
    
  

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

你可能感兴趣的:(编译cm时,maven Read timed out)