UnKnownHostException Reported When Compiling Spring Boot
Symptom
During the Spring Boot compilation, the message "UnKnownHostException" is displayed when www.liquibase.org is accessed. Configure a proxy to solve the problem.

Key Process and Cause Analysis
The host is not mapped. Add proxy configurations to solve the problem.
Conclusion and Solution
- Open the LiquibaseAutoConfigurationTests.java file.
vim ./spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java
- Press i to enter the insert mode and modify the file:
- Add the following content below line 24:
import java.util.Properties;

- Insert the following code in line 76:
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"); }In the preceding example, 127.0.0.1 and 3128 indicate the IP address and port number of the proxy host. Replace them with the actual ones.

Run the :set list command to check the format. Spaces are not allowed. Use Tab to indent the code.
- Add the following content below line 24:
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Recompile Spring Boot.
Parent topic: Troubleshooting