On Wed, 14 Oct 2026 20:30:17 GMT, Sean Mullan <[email protected]> wrote:

>> Actually, `jlink --list-plugins` prints `security-properties.usage`. The 
>> `security-properties.description` is only printed if you don't overload 
>> `getUsage()` in the plugin (which the sec props plugin does because it 
>> extends `AbstractPlugin`). 
>> 
>> There doesn't seem to be a `jlink` option to show one or the other.
>
> I have shortened the usage in 
> https://github.com/openjdk/jdk/pull/31884/changes/9fc7fcdff41bfeba0b8ec96009560f19df50c7d1
>  - let me know if this is better.
> 
> I left the description as-is, because I believe (from [the following 
> code](https://github.com/openjdk/jdk/blob/76310cbf63459861fd99199d9856bee8272111bf/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java#L670))
>  it was intended to be a longer form of instructions than the usage. However, 
> there is clearly an issue with `jlink` as there is no way to display this 
> cleanly. I tried (temporarily) overriding `getUsage()` to return the empty 
> String (which then triggers `TaskHelper` to call `getDescription()`) but what 
> it does instead is print out the description, and then the rest of the 
> plugins, like so:
> 
> 
> jlink --list-plugins
> 
> List of available plugins:
> 
> Plugin Name: security-properties
> Option: --security-properties=<filename>
> Description: Override the security properties in the
> conf/security/java.security configuration file with the properties in the
> specified filename. Security properties with the same name are overridden
> and security properties not present are added to the end of the
> conf/security/java.security configuration file.  Duplicate properties
> (properties with the same name) and include statements in the original
> java.security file are disallowed and treated as an error. Comments in the
> properties file are ignored and not copied. If the properties file contains
> an include statement, it is always added as the last line of the
> conf/security/java.security configuration file, after any new security
> properties that may have been added. The include filename does not need to
> exist at jlink time. If the properties file contains duplicate properties,
> the value of the last property is used.
>   --add-options <options>   Prepend the specified <options> string, which may
>                             include whitespace, before any other options when
>                             invoking the virtual machine in the resulting 
> image.
> 
> ... (rest of plugins)
> 
> 
> I think what would be most useful is if you could add a `--help` option to a 
> plugin, which would then print out the longer description. I'd be glad to 
> file an issue on this, but I don't have enough history with `jlink` to know 
> if there was another intention behind the meaning of the description and 
> when/how it would be displayed.

The `--list-plugins` output is now

  --security-properties <filename>
                            Override the security properties in the
                            conf/security/java.security configuration file
                            with the properties in the specified filename.
                            Security properties with the same name are
                            overridden and security properties not present
                            are added to the end of the
                            conf/security/java.security configuration file.

which is good balance and avoids the details about duplicates, comments and 
include files. Thanks.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/31884#discussion_r4280471145

Reply via email to