Zippy
Small extension for ZIP files
Zippy is small extension for simpler working with ZIP files.
Zippy is a Maven 3.9+ extension and plugin suite for working with ZIP files as dependencies and as build output.
It provides a zip-classpath artifact handler, so dependencies of type=zip-classpath are added to the classpath.
It also provides a zip handler that behaves like plain Maven (not adding ZIPs to classpath), unless the
maveniverse.zippy.zip.classpath=true system property is set; for new projects the explicit zip-classpath type is
recommended. Finally, it provides a zip packaging that produces a ZIP file from (optionally filtered) resources,
based on maven-jar-plugin and accepting mostly the same options.
Sources: https://github.com/maveniverse/zippy
1 - What is it?
Embrace ZIPs
By Java spec, classpath may contain JARs, ZIPs and directories (with .class files). Maven is “not conformant” in
this respect, as while it adds JAR dependencies to classpath, ZIPs are not added.
Zippy helps here.
Zippy extension provides:
- Dependency type
zip-classpath, similar to type=zip, but ZIP declared with this type is added to classpath. - Dependency type
zip, that by default makes Maven behave same as before. But, IF you define Java System Property maveniverse.zippy.zip.classpath=true, then all dependencies of type=zip will be added to classpath. Not recommended for new projects, this is more like a hack. - Packaging
zip, where one can create POM with <packaging>zip</packaging> and unfiltered (and filtered if configured as usual) resources from project will be just zipped up as main artifact.
To use it, just add following bits to your project .mvn/extensions.xml:
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<extension>
<groupId>eu.maveniverse.maven.zippy</groupId>
<artifactId>extension3</artifactId>
<version>${version.zippy}</version>
</extension>
</extensions>
Naturally, this extension applies locally to project only, so it will modify ZIP file handling in situ only.
You can still produce libraries and JARs for downstream consumption that expect same behaviour, but then your consumers must use Zippy as well.