perf: 优化lib上传过程

master
王兵 2 weeks ago
parent 418ec55f27
commit 845f4ed4b9

@ -192,7 +192,16 @@ public class Deploy extends AbstractMojo {
File libDir = new File(targetPath, "lib"); File libDir = new File(targetPath, "lib");
if (libDir.exists() && libDir.isDirectory()) { if (libDir.exists() && libDir.isDirectory()) {
printLog("start upload lib directory"); printLog("start upload lib directory");
client.putFiles(libDir.getAbsolutePath(), serverPath + "/lib"); client.createDirs(serverPath + "/lib");
File[] libFiles = libDir.listFiles();
int totalFiles = libFiles != null ? libFiles.length : 0;
for (int i = 0; i < totalFiles; i++) {
File file = libFiles[i];
String targetPath = (serverPath + "/lib/" + file.getName()).replace('\\', '/');
client.putFile(file.getAbsolutePath(), targetPath);
System.out.print(StrUtil.format("[INFO] upload lib {}/{}", (i + 1), totalFiles) + "\r");
}
System.out.println();
printLog("upload lib directory finish"); printLog("upload lib directory finish");
} else { } else {
printLog("[WARN] lib directory not found: {}, skip lib upload", libDir.getAbsolutePath()); printLog("[WARN] lib directory not found: {}, skip lib upload", libDir.getAbsolutePath());

Loading…
Cancel
Save

Powered by TurnKey Linux.