Support SpringBoot nested jar file #180

Open
opened 2025-12-30 01:21:48 +01:00 by adam · 2 comments
Owner

Originally created by @semistone on GitHub (Jul 8, 2024).

When we use pkl config in Java SprintBoot application
We will get error

Caused by: org.pkl.core.PklException: –– Pkl Error ––
Refusing to load module `jar:nested:/app.jar/!BOOT-INF/classes/!/config/dev.pkl` because it does not match any entry in the module allowlist (`--allowed-modules`).

it's because jar:nested isn't include in allow-modules.

we could fix it by add it into allowModules and change defaultTrustLevel, but how about add jar:nested into java default configuration?

Originally created by @semistone on GitHub (Jul 8, 2024). When we use pkl config in Java SprintBoot application We will get error ``` Caused by: org.pkl.core.PklException: –– Pkl Error –– Refusing to load module `jar:nested:/app.jar/!BOOT-INF/classes/!/config/dev.pkl` because it does not match any entry in the module allowlist (`--allowed-modules`). ``` it's because jar:nested isn't include in allow-modules. we could fix it by add it into allowModules and change defaultTrustLevel, but how about add jar:nested into java default configuration?
Author
Owner

@odenix commented on GitHub (Oct 28, 2024):

@semistone Are you using https://github.com/apple/pkl-spring or plain Pkl?

@odenix commented on GitHub (Oct 28, 2024): @semistone Are you using https://github.com/apple/pkl-spring or plain Pkl?
Author
Owner

@semistone commented on GitHub (Oct 30, 2024):

I used plain Pkl to load non spring configuration
and the application.jar is build by
./gradle assemble

that issue is because the pkl file is in
app.jar:!BOOT-INF/classes/

 jar tfv application.jar|grep pkl                 
...
  1429 Wed Oct 30 06:25:00 JST 2024 BOOT-INF/classes/application.pkl
   396 Wed Oct 30 06:25:00 JST 2024 BOOT-INF/classes/application-local.pkl
@semistone commented on GitHub (Oct 30, 2024): I used plain Pkl to load non spring configuration and the application.jar is build by ./gradle assemble that issue is because the pkl file is in app.jar:!BOOT-INF/classes/ ``` jar tfv application.jar|grep pkl ... 1429 Wed Oct 30 06:25:00 JST 2024 BOOT-INF/classes/application.pkl 396 Wed Oct 30 06:25:00 JST 2024 BOOT-INF/classes/application-local.pkl ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#180