自动打包工具拓展自动打jar包

dev
youhong.ai 2023-07-04 18:59:32 +08:00
parent c95e6e41e8
commit 3c3382f1d2
2 changed files with 4 additions and 1 deletions

View File

@ -55,7 +55,7 @@ public class BuilderPackageEcology extends Application {
try { try {
FileCompressor.compressFiles(filePaths, outputFile.getAbsolutePath(), path -> { FileCompressor.compressFiles(filePaths, outputFile.getAbsolutePath(), path -> {
String rootPath = Util.class.getResource("/").getPath(); String rootPath = Util.class.getResource("/").getPath();
rootPath = rootPath.split(File.separator + "target" + File.separator)[0] + File.separator + "target" + File.separator + "classes" + File.separator; rootPath = rootPath.split(File.separator + FileTreeBuilder.targetPath)[0] + File.separator + FileTreeBuilder.targetPath + "classes" + File.separator;
String replace = "/ecology/" + (isEcology ? "WEB-INF/classes/" : "classbean/"); String replace = "/ecology/" + (isEcology ? "WEB-INF/classes/" : "classbean/");
if (path.endsWith(".jar")) { if (path.endsWith(".jar")) {
replace = "/ecology/WEB-INF/lib/"; replace = "/ecology/WEB-INF/lib/";

View File

@ -12,6 +12,8 @@ public class FileTreeBuilder {
public static final String DIRECTORY_TYPE = "文件夹"; public static final String DIRECTORY_TYPE = "文件夹";
public static final String FILE_TYPE = "文件"; public static final String FILE_TYPE = "文件";
public static String targetPath;
public static FileInfo buildFileTree() { public static FileInfo buildFileTree() {
String directoryPath = "target"; String directoryPath = "target";
List<String> blackList = new ArrayList<>(); List<String> blackList = new ArrayList<>();
@ -31,6 +33,7 @@ public class FileTreeBuilder {
if (!directoryPath.endsWith(File.separator)) { if (!directoryPath.endsWith(File.separator)) {
directoryPath += File.separator; directoryPath += File.separator;
} }
targetPath = directoryPath;
} }
List<String> blacklistPrefixes = Arrays.asList( List<String> blacklistPrefixes = Arrays.asList(
directoryPath + "generated-sources", directoryPath + "generated-sources",