[ 
https://issues.apache.org/jira/browse/MJLINK-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17866301#comment-17866301
 ] 

ASF GitHub Bot commented on MJLINK-83:
--------------------------------------

pedro-w commented on PR #202:
URL: 
https://github.com/apache/maven-jlink-plugin/pull/202#issuecomment-2230305065

   I've been able to do it using your second suggested method, i.e. using 
`org.apache.maven.api.plugin.testing.MojoExtension.setVariableValueToObject`
   
   The calls now look like this:
   
   ```
           JLinkMojo mojo = new JLinkMojo();
           setVariableValueToObject(mojo, "launcher", "com.example.Launch");
   ```
   
   What do you think? I just couldn't get the first method, using the 
`@InjectMojo` annotations and associated mechanisms to work at all. It seemed 
to be a problem with the dependencies and their versions.




> Allow adding multiple launchers to a jlink'ed image
> ---------------------------------------------------
>
>                 Key: MJLINK-83
>                 URL: https://issues.apache.org/jira/browse/MJLINK-83
>             Project: Maven JLink Plugin
>          Issue Type: Improvement
>    Affects Versions: 3.2.0
>         Environment: (applies to all platforms)
>            Reporter: Peter Hull
>            Priority: Minor
>
> The {{jlink}} command line tool allows the {{--launcher}} argument to be 
> specified multiple times to create multiple launcher scripts in the image. 
> However the maven plugin only passes on one {{<launcher>}} element from its 
> configuration section to the tool. If multiple are specified, the last one 
> takes precedence. I would like to improve this so the plugin will pass 
> multiple launcher specs on to the {{jlink}} tool. I suggest the config should 
> look like:
> {noformat}
> <launcher>command=module/main</launcher>{noformat}
> (as before, for backward compatibility and the common case where there is 
> only one)
> or
>  
> {noformat}
> <launchers>
>  <launcher>command1=module1/main1</launcher>
>  <launcher>command2=module2/main2</launcher>
>  ...
> </launchers>
> {noformat}
>  
> where {{<launchers>}} can contain zero or more {{<launcher>}} elements with 
> the same syntax as the existing element.
> One remaining question - what do do if the config specifies both  
> {{<launcher>}} and {{<launchers>}} - combine the two or signal an error?
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to