I have a Java project and I need to make a maven plugin to prepare a zip archive with the updates. Archive has a simple structure: libraries in the lib directory, update the directory upd and a text file with the build number.
The task is simple-copy the files in the appropriate directory and compress the output root folder is in *.the zip on the Assembly stage.
I found a few plugins that can copy and zip files:
The Mojo Executer to run a homemade or other plugins.
Antrun / Maven-plugin for build-to copy directories and zip folders
Maven-resources-plugin to copy these files.
In addition, I can write your @MOJO class which will manually copy the directory by using Apache FileUtils, for example, and do the compression using Java code in my class @MOJO).
Please advise-what is the correct way? Write a Mojo class with the described action or to use ready-made plugins?
How to set the assembly in the plugin directory that I need to copy and create the archive?
How to write a build number to a file?