MVN_FILE=/usr/share/java/maven-3/conf/settings.xml
sed -i 's|| xxx-mirror * https://nexus.xxx.com/nexus/content/groups/public/ |' $MVN_FILE
sed -i '\||i xxx-nexus xxx-nexus xxx-nexus https://fake.xxx.com/ true true ' $MVN_FILE
sed -i '\||i xxx-nexus ' $MVN_FILE
如果只设置镜像,只有maven central repository,查找SNAPSHOT会有问题,需要通过配置文件profile增加其它repository.
https://maven.apache.org/repositories/index.html
https://maven.apache.org/repository/guide-central-repository-upload.html
https://maven.apache.org/guides/mini/guide-multiple-repositories.html