extract_deps.py 435 B

1234567891011121314
  1. import zipfile, os
  2. jar = "target/resource-platform-v5.jar"
  3. out_dir = "lib"
  4. os.makedirs(out_dir, exist_ok=True)
  5. z = zipfile.ZipFile(jar)
  6. n = 0
  7. for name in z.namelist():
  8. if name.startswith("BOOT-INF/lib/") and name.endswith(".jar"):
  9. out = os.path.join(out_dir, os.path.basename(name))
  10. with open(out, "wb") as f:
  11. f.write(z.read(name))
  12. n += 1
  13. print("extracted", n, "dependency jars into", out_dir)