编译spring-boot-cli过程中遇到spring-boot-cli UnknownHostException:repo1.maven.org测试问题,提示“java.net.UnknownHostException:repo1.maven.org”。
Host未建立映射关系,可以通过增加代理配置解决。
vim /home/spring-boot/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/CompositeProxySelector.java
import java.util.Properties;
static { Properties props = System.getProperties(); props.put("http.proxyHost", "127.0.0.1"); props.put("http.proxyPort", "3128"); props.put("https.proxyHost", "127.0.0.1"); props.put("https.proxyPort", "3128"); }
其中,127.0.0.1和3128分别表示代理主机的IP地址和端口,操作时请需要根据实际代理环境配置。
请使用:set list检查格式。不能出现空格,请使用Tab作为代码缩进。