刪除_remote.repositories就行了java
刪除代碼apache
static int i=0; public static void main(String[] args) { FileUtil.removeFiles( new File("C:\\Program Files\\apache-maven-3.5.3-bin\\repository")); } private static void removeFiles(File ff){ //i++;if(i>4)return; if(ff.isFile()){ if("_remote.repositories".equals(ff.getName())){ ff.delete(); System.err.println("File remove >> "+ff.getAbsoluteFile()); } }else if(ff.isDirectory()){ File[] fileList = ff.listFiles(); if(fileList!=null && fileList.length>0){ for(File file:fileList){ removeFiles(file); } } }else{ System.err.println("============Unknow============"); } }