2
0

feat: init build release

This commit is contained in:
simonzhangsz
2024-12-12 18:10:43 +08:00
parent 4f075ae506
commit 60a8af09be
43 changed files with 1048 additions and 1 deletions

28
bin/printJarVer.java Normal file
View File

@@ -0,0 +1,28 @@
import java.io.File;
import java.io.IOException;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
public class printJarVer {
public static void main(String[] args) {
if (args.length == 0) {
System.out.println("Please input jars path and file name.");
return;
}
for (String jarPath : args) {
File jarFile = new File(jarPath);
String jarName = jarFile.getName();
try (JarFile jar = new JarFile(jarFile)) {
Manifest manifest = jar.getManifest();
Attributes attributes = manifest.getMainAttributes();
String version = attributes.getValue("Implementation-Version");
System.out.println(jarName + " version: " + (version != null ? version : "not found version info"));
} catch (IOException e) {
System.out.println("Can't read " + jarName + " version.");
e.printStackTrace();
}
}
}
}