编辑~/.m2/settings.xml
$ vim ~/.m2/settings.xml
配置如下代理的协议,地址,端口
my_proxy true https 192.168.14.1 1080 localhost:127.0.0.1
使用mvn命令时指定配置文件
$ mvn archetype:generate \-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots \-DarchetypeGroupId=org.apache.beam \-DarchetypeArtifactId=beam-sdks-java-maven-archetypes-examples \-DarchetypeVersion=LATEST \-DgroupId=org.example \-DartifactId=word-count-beam \-Dversion="0.1" \-Dpackage=org.apache.beam.examples \-DinteractiveMode=false \-s ~/.m2/settings.xml