Archive extension for JPMS modules

Programmatically, read and write, the source or binary of JPMS modules.

Auto-require functionality will attempt to write all the necessary requires clauses in module-info, this includes the standard JDK modules but also those available on the classpath (including automatic modules).

For more elaborate examples see archive.glue.

Dependency Graph

Module Dependency


The following creates an in-memory JPMS module with export predicate:

	Predicate<String> predicate = e -> !e.contains("internal");

	Archive archive = archive()


The following finds the JAR for a given class and “wraps it”, (scans classes to determine requires) producing a JPMS compliant module:

	Path jar = Paths.get(Resources.sourceOfResource(Exceptional.class));

	// removes any existing module-info.class
	Predicate<String> filter = n -> !"module-info.class".equals(n);

	Archive jpmsed = archive()
							.exporting(p -> true)
			.sourcing(contentFrom(jar, filter))

	ArchiveResource moduleInfoBinary = jpmsed.content("module-info.class").orElseThrow(NullPointerException::new);

	ModuleInfo moduleInfoSource =;


Back to top

Version: 0.1.0. Last Published: 2018-10-08.

Earcam Maven Skin.