<div dir="ltr">Hi,<div><br></div><div>I'm working on a Maven plugin which calls jlink to produce a runtime image.</div><div><br></div><div>The launcher main method sets up a graph of ModuleLayers. The module jar files for these layers are added to runtime image folder lib/myframework/modules by the Maven plugin, along with some metadata defining the graph of ModuleLayers to be constructed.</div><div><br></div><div>Since the "actual" module graph in this case isn't visible for jlink, the Maven plugin inspects all module descriptors and collects all "java.*" required modules which it adds to the "-add-modules" jlink option. This works fine in the sense that the these modules are included in the runtime image.</div><div><br></div><div>When executing the custom launcher however, the required images are not added to the boot layer. The only way I've found so far to get around this is to add "--add-modules java.sql" etc to the JLINK_VM_OPTIONS environment variable in the launcher script. This file can of course be edited by my Maven plugin, but this feels a bit dirty.</div><div><br></div><div>So far I haven't found a way to tell jlink which modules should be added to the launcher's boot modules. Am I missing some switch?</div><div><br></div><div>PS: I know I could just add all modules via --add-modules instead of building my custom layer graph, but that graph is there for reasons and I don't think it will run well on a collapsed boot layer.</div><div><br></div><div>Thanks,</div><div>Eirik.</div><div><div><br></div></div></div>