-
Notifications
You must be signed in to change notification settings - Fork 34
[#502] - Add prefix to zip entries #503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Requires maven-jlink-plugin 3.2.1-SNAPSHOT with apache/maven-jlink-plugin#503
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, but is there any way you could add an integration test that actually runs a jlinked image with a prefix?
@elharo I updated testcase to extract ZIP which contains prefix, and execute the launcher. It works fine on Linux, but it might not work on Windows because the ZIP would be extracted by |
All of tests on Windows were hanged due to new tests for this PR. I think the cause of the hang is I tweaked a testcase in the latest commit, and it works fine on both Ubuntu 24 and Windows 11. Could you approve to run the workflow? I believe it works fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for docs, looks good to me.
@@ -368,6 +368,14 @@ public class JLinkMojo extends AbstractJLinkMojo { | |||
@Parameter | |||
private List<Resource> additionalResources; | |||
|
|||
/** | |||
* Add prefix to all of zip entries. It would be treated as a directory if the prefix ends with "/". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment needs clarification, as it goes into the docs (site).
- If it does not end with
/
, what will happen? - Isn't the prefix always supposed to be a directory?
- What does the default do (explain to users)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the prefix always supposed to be a directory?
Yes, I think so because if the prefix does not have "/" in its tail, it breaks JDK directory structure - it means any launcher and java
command in bin
directory would not work. I will fix, and clarify Javadoc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bmarwell
I fixed docs, and always treats this value as a directory. Could you review again?
module com.corporate.project { | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably doesn't matter, but maybe we can find another example module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain details of your comment?
This testcase creates launcher as following:
<launcher>helloworld=com.corporate.project/com.corporate.project.HelloWorld</launcher>
I think the app should be modulalized for --launcher
option in jlink. So I think module-info.java
is necessary for this test.
Do you have any comments? Comments are welcome. I can work for them if needs. |
I would like to introduce
zipDirPrefix
to add prefix to zip entries. See #502 for details.Following this checklist to help us incorporate your
contribution quickly and easily:
for the change (usually before you start working on it). Trivial changes like typos do not
require a GitHub issue. Your pull request should address just this issue, without
pulling in other changes.
[#<num>] - Fixes bug in ApproximateQuantiles
,where you replace
#<num>
with the appropriate GitHub issue. Best practiceis to use the GitHub issue title in the pull request title and in the first line of the
commit message.
mvn clean verify
to make sure basic checks pass. A more thorough check willbe performed on your pull request automatically.
mvn -Prun-its clean verify
).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
In any other case, please file an Apache Individual Contributor License Agreement.