Class UnpackZipMojo
java.lang.Object
network.ike.plugin.UnpackZipMojo
- All Implemented Interfaces:
org.apache.maven.api.plugin.Mojo
@Mojo(name="unpack-zip",
defaultPhase="generate-resources")
public class UnpackZipMojo
extends Object
implements org.apache.maven.api.plugin.Mojo
Download a zip archive from a URL and unpack it.
Uses ZipInputStream directly, bypassing
Plexus Archiver. This avoids the 1800+ case-sensitivity warnings
that Plexus emits on macOS when a zip contains entries that differ
only by case (e.g., the DocBook XSL distribution).
The downloaded zip is cached in a local directory so subsequent builds skip the download when the cached file already exists.
This goal replaces both download-maven-plugin:wget and
the exec-maven-plugin call to system unzip in the
docbook-xsl build.
Usage:
<execution>
<id>download-and-unpack-docbook-xsl</id>
<phase>generate-resources</phase>
<goals><goal>unpack-zip</goal></goals>
<configuration>
<url>https://github.com/.../docbook-xsl-1.79.2.zip</url>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
- Since:
- 100
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
UnpackZipMojo
public UnpackZipMojo()Creates this goal instance.
-
-
Method Details
-
getLog
protected org.apache.maven.api.plugin.Log getLog()Access the Maven logger.- Returns:
- the logger
-
execute
public void execute() throws org.apache.maven.api.plugin.MojoException- Specified by:
executein interfaceorg.apache.maven.api.plugin.Mojo- Throws:
org.apache.maven.api.plugin.MojoException
-