Skip to content

8388795: Add --app-resources CLI option to copy files and directories into the application resources directory - #32474

Open
sashamatveev wants to merge 2 commits into
openjdk:masterfrom
sashamatveev:JDK-8388795
Open

8388795: Add --app-resources CLI option to copy files and directories into the application resources directory#32474
sashamatveev wants to merge 2 commits into
openjdk:masterfrom
sashamatveev:JDK-8388795

Conversation

@sashamatveev

@sashamatveev sashamatveev commented Aug 20, 2026

Copy link
Copy Markdown
Member
  • Added --app-resources.

Specification:

--app-resources

    A File.pathSeparator separated list of paths

    Additional application files and directories to copy into the
    application resources directory.

    This option may be specified multiple times.

    Destination:
        Windows: application image root
        Linux: application image lib directory
        macOS: Contents/Resources


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8390349 to be approved

Issues

  • JDK-8388795: Add --app-resources CLI option to copy files and directories into the application resources directory (Enhancement - P4)
  • JDK-8390349: Add --app-resources CLI option to copy files and directories into the application resources directory (CSR)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/32474/head:pull/32474
$ git checkout pull/32474

Update a local copy of the PR:
$ git checkout pull/32474
$ git pull https://git.openjdk.org/jdk.git pull/32474/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 32474

View PR using the GUI difftool:
$ git pr show -t 32474

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32474.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Aug 20, 2026

Copy link
Copy Markdown

👋 Welcome back almatvee! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk

openjdk Bot commented Aug 20, 2026

Copy link
Copy Markdown

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot added csr Pull request needs approved CSR before integration core-libs core-libs-dev@openjdk.org labels Aug 20, 2026
@openjdk

openjdk Bot commented Aug 20, 2026

Copy link
Copy Markdown

@sashamatveev The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Aug 20, 2026
@mlbridge

mlbridge Bot commented Aug 20, 2026

Copy link
Copy Markdown

Webrevs

@ecki

ecki commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

I can see that the platforms require different layouts, but the lib/ vs / distinction seems like a unnecessary case the app would need to observe?

@sashamatveev

Copy link
Copy Markdown
Member Author

I can see that the platforms require different layouts, but the lib/ vs / distinction seems like a unnecessary case the app would need to observe?

Currently --app-content writes to "lib" on Linux, root on Windows and "Contents" on macOS. --app-resources only changes destination on macOS.

Comment thread src/jdk.jpackage/share/man/jpackage.md Outdated
Comment thread test/jdk/tools/jpackage/share/AppImageFillOrderTest.java Outdated
Comment thread test/jdk/tools/jpackage/share/AppContentAndResourcesTest.java Outdated
Comment thread test/jdk/tools/jpackage/share/AppContentTest.java
Comment thread test/jdk/tools/jpackage/share/AppContentAndResourcesTest.java Outdated
Comment thread test/jdk/tools/jpackage/share/AppContentAndResourcesTest.java Outdated
… into the application resources directory [v2]
@sashamatveev

Copy link
Copy Markdown
Member Author

8388795: Add --app-resources CLI option to copy files and directories into the application resources directory [v2]

  • Fixed latest review comments.

Comment thread test/jdk/tools/jpackage/share/AppContentTest.java
.addInitializer(JPackageCommand::setFakeRuntime)
.addInitializer(cmd -> inputs.addTo(cmd, resourcesFirst))
.addInstallVerifier(inputs::verify)
.run();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably don't want to install these packages in the test environment, where test packages can be installed; we can do all verification in an unpacked image, and installation doesn't improve coverage. To avoid package installation and limit testing to unpacking only, use .run(Action.CREATE_AND_UNPACK) instead of .run().

Comment on lines +154 to +160
\ A colon (":") list of paths to files and/or directories\n\
\ to add to the application resources directory.\n\
\ A colliding file from --app-resources replaces\n\
\ one from --app-content.\n\
\ This option can be used more than once.\n\
\ Destination:\n\
\ Linux: application image lib directory

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to explicitly specify where the content will be copied and eliminate the "Destination:" section:

\          A colon-separated list of paths to files and/or directories\n\
\          to add to the application's "lib" directory.\n\
\          If a file from --app-resources conflicts with one from\n\
          --app-content, the file from --app-resources is used.\n\
\          This option can be used more than once.\n\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org csr Pull request needs approved CSR before integration rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

3 participants