I wish to create a zip archive of my "target" directory (${project.build.directory). using the maven-assembly-plugin seems to me like overkill for such a simple task (and a bit complicated - why must I use another file, the assembly descriptor, for such a task) I can't locate the seemingly more simple maven-zip-plugin in the http://repo1.maven.org/maven2 repository.
Any input?
You can accomplish this using maven-assembly-plugin that Pradeep suggested. And also using maven-antrun-plugin. See the pom and zip task. Include the files that you want in fileset.
The Maven Archiver is mainly used by plugins to handle packaging. The version numbers referenced in the Since column on this page are the version of the Maven Archiver component - not for any specific plugin. To see which version of Maven Archiver a plugin uses, go to the site for that plugin.
The Assembly Plugin for Maven enables developers to combine project output into a single distributable archive that also contains dependencies, modules, site documentation, and other files. Your project can easily build distribution "assemblies" using one of the prefabricated assembly descriptors.
org.apache.maven.plugins » maven-javadoc-pluginApache. The Apache Maven Javadoc Plugin is a plugin that uses the javadoc tool for generating javadocs for the specified project. Last Release on Aug 13, 2022.
If the bin
predefined assembly descriptor doesn't suit your needs, then you have three options:
Personally, I would just use the maven-assembly-plugin with the following zip.xml
descriptor:
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> <id>bin</id> <baseDirectory>/</baseDirectory> <formats> <format>zip</format> </formats> <fileSets> <fileSet> <directory>${project.build.directory}</directory> </fileSet> </fileSets> </assembly>
And in your POM:
<plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.6</version> <configuration> <descriptors> <descriptor>src/main/assembly/zip.xml</descriptor> </descriptors> </configuration> <executions> <execution> <id>make-assembly</id> <!-- this is used for inheritance merges --> <phase>package</phase> <!-- append to the packaging phase. --> <goals> <goal>single</goal> <!-- goals == mojos --> </goals> </execution> </executions> </plugin>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With