public static String determinePackageVersion(Class<?> clz) {
        try {

            String implementationVersion = clz.getPackage().getImplementationVersion();
            if (implementationVersion != null) {
                return implementationVersion;
            }
            CodeSource codeSource = clz.getProtectionDomain().getCodeSource();
            if (codeSource == null) {
                return null;
            }
            URL codeSourceLocation = codeSource.getLocation();

            URLConnection connection = codeSourceLocation.openConnection();
            if (connection instanceof JarURLConnection) {
                return getImplementationVersion(((JarURLConnection) connection).getJarFile());
            }
            final File file = new File(codeSourceLocation.toURI());
            // idea 场景，查找版本失败
            if (!file.exists() || file.isDirectory()) {
                return "UNKNOWN";
            }
            try (JarFile jarFile = new JarFile(file)) {
                return getImplementationVersion(jarFile);
            }
        }
        catch (Throwable t) {
            log.warn("[JavaUtils] determinePackageVersion for clz[{}] failed, msg: {}", clz.getSimpleName(), t.toString());
            // windows 下无权限访问会一直报错一直重试，需要在此兼容
            return "UNKNOWN";
        }
    }
@Test
    void determinePackageVersion() {

        String packageVersion = JavaUtils.determinePackageVersion(LoggerFactory.class);
        log.info("[determinePackageVersion] LoggerFactory's package version: {}", packageVersion);
    }