Add prefix to zip entries
New feature, improvement proposal
maven-jlink-plugin can generate ZIP archive, but we cannot append any prefixes into it, so the user extracts the archive like JAVA_HOME image like:
bin/ conf/ legal/ lib/ release
It is better if we can add prefix like following because the user can extract files into 1 directory if the user forget to create a directory before extraction - it makes easy to manage / delete the app.
app/
├── bin/
├── conf/
├── legal/
├── lib/
└── release
This isn't a generic zip plugin. It's specifically designed to create JLink images which happen to be zip files, I think. Do the runtime images still work if one adds a prefix inside the zip?
Do the runtime images still work if one adds a prefix inside the zip?
Sure.
As I wrote in the description, this PR intends to add prefix like a parent directory. For example, I want to package jlink'ed image like this. (full of pom.xml is here )
<configuration>
<zipDirPrefix>${imageName}/</zipDirPrefix>
<classifier>${package.os.name}-${os.arch}</classifier>
Then the user can recognize all of artifacts are in ${imageName} directory when the user extracts the zip. The user can run the app in ${imageName}/bin/[app].
As I wrote in the description, this PR intends to add prefix like a parent directory. For example, I want to package jlink'ed image like this. (full of
pom.xmlis here )
Not sure, but my approach would be:
- unpack it to a target/app directory
- use jreleaser to add app/bin/start.sh and app/bin/start.cmd (which then packages it for you).
This issue has been resolved in https://github.com/apache/maven-jlink-plugin/commit/4ad3570632edd3ec1db6e16bba76bb86d8724db8