You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "gunter zeilinger (Jira)" <ji...@apache.org> on 2019/09/08 13:48:00 UTC

[jira] [Commented] (MJAR-238) Allow setting of module main class

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

gunter zeilinger commented on MJAR-238:
---------------------------------------

Does [78dbb2918fcb2086fe5601eb95bb294bcc274639|https://gitbox.apache.org/repos/asf?p=maven-jar-plugin.git;a=commit;h=78dbb2918fcb2086fe5601eb95bb294bcc274639]  also enable to set the module version?

There is the sentence
??Starting with version 3.1.2, if the JAR file contains <<<module-info.class>>>, this plugin will update the modular descriptor (<<<module-info.class>>>) with additional attributes ....??
but I did not found a description how to configure the value passed to [ModularJarArchiver#setModuleVersion|https://codehaus-plexus.github.io/plexus-archiver/apidocs/org/codehaus/plexus/archiver/jar/ModularJarArchiver.html#setModuleVersion(java.lang.String)].

> Allow setting of module main class
> ----------------------------------
>
>                 Key: MJAR-238
>                 URL: https://issues.apache.org/jira/browse/MJAR-238
>             Project: Maven JAR Plugin
>          Issue Type: Improvement
>         Environment: Java9 build 9+176, MacOS
>            Reporter: Machiel Groeneveld
>            Assignee: Enrico Olivelli
>            Priority: Minor
>             Fix For: 3.1.2
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When a Java9 module is created using the maven-jar plugin, setting the manifest/mainclass does not set the module main class. Therefore the module is not executable without specifying the main class. Executing the module using java -m domain.app gives the following error:
> _module jigsaw.app does not have a MainClass attribute_
> According to the module specification a module (jar) can have a main class set. If I understand correctly it's inside the module-info.class as a property called ModuleMainClass
> When using the JDK9 jar command it will update the jar and the module-info.class.
> {noformat}
>   -e, --main-class=CLASSNAME The application entry point for stand-alone
>                              applications bundled into a modular, or executable,
>                              jar archive
> {noformat}
> I guess it would make sense to have this as a separate configuration item since the mainclass entry in the manifest file is not needed in 'module mode' and vice versa.
> If this is a duplicate of another issue, please close this one, I couldn't find any existing issues related to this.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)