public void buildMultiReleaseJar() throws IOException { JarBuilder jb = customMultiReleaseJar("multi-release.jar", "true"); addEntries(jb); jb.addEntry( "META-INF/versions/9/version/Version.class", version9Classes.get("version.Version")); jb.build(); }
public void buildCustomMultiReleaseJar( String filename, String multiReleaseValue, Map<String, String> extraAttributes) throws IOException { JarBuilder jb = new JarBuilder(filename); extraAttributes.entrySet().forEach(entry -> jb.addAttribute(entry.getKey(), entry.getValue())); jb.addAttribute("Multi-Release", multiReleaseValue); jb.build(); }
public void buildUnversionedJar() throws IOException { JarBuilder jb = new JarBuilder("unversioned.jar"); jb.addEntry("README", readme8.getBytes()); jb.addEntry("version/Main.java", main.getBytes()); jb.addEntry("version/Main.class", rootClasses.get("version.Main")); jb.addEntry("version/Version.java", java8.getBytes()); jb.addEntry("version/Version.class", rootClasses.get("version.Version")); jb.build(); }
private static File buildJar2() throws FileNotFoundException, IOException { JarBuilder jar2Builder = new JarBuilder(tmpFolder, "jar2.jar"); jar2Builder.addResourceFile("com/jar2/resource.file", "jar2"); jar2Builder.addResourceFile("com/test/resource2.file", "resource2"); return jar2Builder.build(); }
private static File buildJar3() throws FileNotFoundException, IOException { JarBuilder jar3Builder = new JarBuilder(tmpFolder, "jar3.jar"); jar3Builder.addResourceFile("com/test/resource3.file", "resource3"); jar3Builder.addResourceFile("com/missing/jar3/resource.file", "jar3"); return jar3Builder.build(); }
public void buildShortMultiReleaseJar() throws IOException { JarBuilder jb = customMultiReleaseJar("short-multi-release.jar", "true"); addEntries(jb); jb.build(); }