File ---> Setting ---> Editor ---> General ----> Auto Import
IDEA 自动清除不使用的 引用包
原文:https://www.cnblogs.com/wongzzh/p/15018678.html